Image-based arc fault diagnosis method and related device
By using a camera module in the distribution ring network cabinet to capture images and train a machine learning model, the problems of high cost and insufficient real-time performance of high-precision sensors were solved, and low-cost, high-real-time arc fault detection was achieved.
Patent Information
- Application Number
- CN202511308176.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-15
AI Technical Summary
In the existing technology, high-precision sensors are expensive and lack real-time performance, making it difficult to achieve low-cost, high-real-time arc fault detection.
An image-based arc fault diagnosis method is adopted. Color images of the distribution ring main cabinet are collected by m camera modules, preprocessed and labeled, and a machine learning model is trained to realize the identification and location of arc fault types.
The detection cost is reduced, the real-time performance and accuracy of arc fault detection are improved, and low-cost and high-real-time arc fault detection is achieved.
Smart Images

Figure CN120807522A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of arc fault recognition, and in particular to an arc fault diagnosis method based on images and related devices. BACKGROUND
[0002] In a power system, low-voltage arc as a common and extremely dangerous electrical fault form seriously threatens the safety of power facilities and personnel. Low-voltage arc is usually caused by poor contact, conductor aging, insulation damage, foreign matter intrusion and other factors.
[0003] At present, arc fault is generally detected by ultra-high frequency sensors or infrared thermal imagers, but high-precision sensors are expensive and have high operating costs, and at the same time, such sensors lack real-time performance and have response delays when arc faults occur, making it difficult to capture arc information in the early stage of the fault. Therefore, how to realize low-cost and high-real-time arc fault detection has become a problem to be solved. SUMMARY
[0004] The embodiments of the present application provide an arc fault diagnosis method based on images and related devices, which realizes low-cost and high-real-time arc fault detection.
[0005] In a first aspect, the embodiments of the present application provide an arc fault diagnosis method based on images, applied to a controller in an arc fault diagnosis system, the arc fault diagnosis system further comprising m power distribution ring network cabinets and m camera modules, one camera module being arranged in each power distribution ring network cabinet, m being a positive integer, and the method comprising: acquiring color images of the m power distribution ring network cabinets through the m camera modules to obtain first color image data; preprocessing the first color image data to obtain second color image data; labeling each data in the second color image data with a corresponding fault type and a spatial coordinate of the fault type to obtain a labeled data set; training an initial machine learning model based on the labeled data set to obtain a target machine learning model; acquiring a color image to be diagnosed; inputting the color image to be diagnosed into the target machine learning model to obtain a target diagnosis result; the target diagnosis result comprising a target fault type and a spatial coordinate corresponding to the target fault type; the target fault type comprising one of the following: no fault, phase-to-phase arc fault, single-phase ground arc fault, virtual contact arc fault, and switch breakdown arc fault.
[0006] In a second aspect, an embodiment of the present application provides an arc fault diagnosis device based on images, applied to a controller in an arc fault diagnosis system, the arc fault diagnosis system further comprising m power distribution ring network cabinets and m camera modules, one camera module being arranged in each power distribution ring network cabinet, m being a positive integer, and the device comprising: an acquisition unit, a model training unit, and a diagnosis unit, wherein: The acquisition unit is configured to acquire color images of the m power distribution ring network cabinets through the m camera modules to obtain first color image data. The model training unit is configured to pre-process the first color image data to obtain second color image data, label each data in the second color image data with a corresponding fault type and a spatial coordinate of the fault type to obtain a labeled data set, train an initial machine learning model based on the labeled data set to obtain a target machine learning model. The acquisition unit is further configured to acquire a color image to be diagnosed. The diagnosis unit is configured to input the color image to be diagnosed into the target machine learning model to obtain a target diagnosis result, the target diagnosis result comprising a target fault type and a spatial coordinate corresponding to the target fault type, and the target fault type comprising one of the following: no fault, phase-to-phase arc fault, single-phase ground arc fault, virtual contact arc fault, and switch breakdown arc fault.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs comprise instructions for performing the steps in the first aspect of the embodiments of the present application.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product can be a software installation package.
[0010] The present application has the following advantages: It can be seen that the image-based arc fault diagnosis method described in this application adopts m camera modules as core sensing devices. The camera modules are mature mass-produced equipment, and the cost of each camera module is much lower than the high-precision sensors (for example, ultra-high frequency sensors or infrared thermal imagers) that traditional arc detection relies on. As a result, the detection cost is greatly reduced. In addition, by performing diagnostic reasoning on the color image to be diagnosed through the target machine learning model, the detection results can be obtained quickly and accurately, thereby improving the real-time performance of arc fault detection. That is, low-cost and high-real-time arc fault detection is achieved through this method. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0012] Figure 1 This is a schematic structural diagram of an arc fault diagnosis system provided by an embodiment of the present application; Figure 2 This is an application scenario diagram of an image-based arc fault diagnosis method provided in an embodiment of the present application; Figure 3 This is a flow chart of an image-based arc fault diagnosis method provided in an embodiment of the present application; Figure 4 This is a flowchart of a method for obtaining a labeled data set provided in an embodiment of the present application; Figure 5 This is a flowchart of a method for obtaining a target machine learning model provided in an embodiment of the present application; Figure 6 This is a flowchart of a method for obtaining an initial machine learning model provided in an embodiment of the present application; Figure 7 This is a block diagram of the functional units of an image-based arc fault diagnosis device provided in an embodiment of the present application; Figure 8 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0014] The terms "first", "second", and the like in the description and in the claims of the present application and above-described drawings are used to distinguish different objects, and are not used to describe a particular order. In addition, the terms "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to these processes, methods, products, or devices.
[0015] It should be understood that the term "and / or" herein only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in this paper represents that the front and rear associated objects are a "or" relationship. "Multiple" in the embodiments of the present application means two or more.
[0016] The "at least one" or similar expressions in the embodiments of the present application mean any combination of these items, including any combination of single item or multiple items, means one or more, and multiple means two or more. For example, at least one of a, b or c can represent the following seven cases: a, b, c, a and b, a and c, b and c, a, b and c. Wherein, each of a, b and c can be an element or a set containing one or more elements.
[0017] The "connection" appearing in the embodiments of the present application means direct connection or indirect connection and various connection modes to realize communication between devices, which is not limited by the embodiments of the present application.
[0018] In this paper, the mention of "embodiments" means that the specific features, structures or characteristics described in conjunction with the embodiments can be included in at least one embodiment of the present application. The appearance of this phrase in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment to other embodiments. The skilled person in the art explicitly and implicitly understands that the embodiments described herein can be combined with other embodiments.
[0019] The electronic device described in the embodiments of the present application can include a smart phone (such as an Android phone, an iOS phone, a Windows Phone phone, etc.), a tablet computer, a palm computer, a notebook computer, a video matrix, a monitoring platform, a mobile internet device (MID) or a wearable device, etc. The above are only examples, not exhaustive, including but not limited to the above devices.
[0020] Of course, the above-mentioned electronic device can also be an arc fault diagnosis system.
[0021] The related content, concepts, meanings, technical problems, technical solutions, beneficial effects and the like involved in the embodiments of the present application are described below.
[0022] First, some professional terms involved in the present application are explained: Arc fault: refers to the phenomenon of gas discharge caused by current passing through air or other non-conductive media due to poor contact, conductor aging, insulation damage, foreign matter intrusion, etc. in electrical equipment (such as power distribution ring network cabinet, switch cabinet). Arc fault occurs with high temperature (up to thousands of degrees Celsius), strong light and electromagnetic radiation, which may cause equipment burning, fire and even personal injury, with the characteristics of suddenness, concealment and destructiveness.
[0023] Machine learning model: refers to an algorithm model that learns the law through training data to realize automatic decision for a specific task (such as arc fault type identification).
[0024] RGB color channel: refers to the three basic channels used to represent colors in a color image, corresponding to red (R), green (G), and blue (B). Most colors in nature can be generated by mixing these three primary colors in different proportions. Each pixel point of an image is described by the brightness values (usually integers from 0 to 255) of the R, G, and B channels.
[0025] Computing power requirement of the model: refers to the computing power required by the machine learning model in the training or inference process, usually measured by floating point operations per second (FLOPS) or operations per second (OPS). The computing power requirement is directly related to the complexity of the model. The computing power requirement of a simple model (such as support vector machine) is low, which is suitable for edge devices; the computing power requirement of a complex model (such as deep convolutional neural network) is high, which needs to be deployed on a server or high-performance computing platform.
[0026] Inference delay: refers to the total time from inputting the data to be processed (such as the color image to be diagnosed) to outputting the result (such as the fault type, spatial coordinates) of the machine learning model, usually measured in milliseconds. Inference delay is a key indicator of model real-time performance. The lower the delay, the faster the model responds to faults. In the present application, the inference delay needs to be controlled within the range allowed by the actual application to realize immediate diagnosis and rapid response to arc faults and avoid the spread of faults due to delay.
[0027] Please refer to Figure 1 , Figure 1 is a structural schematic diagram of an arc fault diagnosis system provided by the embodiments of the present application; it can be known that the arc fault diagnosis system (hereinafter referred to as the system) comprises a controller, m power distribution ring network cabinets, m camera modules, etc., which are not limited here; wherein: The controller is the core processing unit of the system, responsible for coordinating the reception, processing, model inference, and diagnostic result output of image data, and is the core carrier for realizing automatic identification and decision-making of arc fault.
[0028] The m power distribution ring network cabinets are the possible occurrence places of arc faults, and the system realizes fault monitoring through image collection of the internal state thereof.
[0029] It needs to be explained that the power distribution ring network cabinet is a key equipment in the urban power distribution network, used to realize the ring network power supply of cable lines, and contains components such as switches, busbars, and cable joints inside, which are prone to arc faults due to poor contact, insulation aging, etc.
[0030] The m camera modules, as image collection devices, are responsible for real-time shooting of color images inside the corresponding power distribution ring network cabinets, providing raw visual data for fault diagnosis. It is necessary to continuously capture the dynamic changes inside the ring network cabinet, especially the light intensity, color, and spatial distribution characteristics when an arc fault occurs.
[0031] It needs to be explained that the camera module can be an industrial-grade color camera with a resolution greater than or equal to 1080P to ensure that it can clearly capture the subtle features of the arc (such as the light spot of the tip discharge and the local bright spot of the poor contact); the frame rate is greater than or equal to 30fps to ensure continuous capture of dynamic arcs (such as arc drawing and transient arc during switching), avoiding motion blur; the protection level of the camera module needs to be IP65 or above to resist dust and moisture (such as condensate water) inside the ring network cabinet, and has the ability to resist electromagnetic interference (through electromagnetic shielding design or filtering circuit to adapt to the strong electromagnetic environment inside the cabinet).
[0032] Please refer to Figure 2 , Figure 2 The application scenario diagram of the arc fault diagnosis method based on images provided by the embodiment of the present application can be known that m can be equal to 3, and the m power distribution ring network cabinets can include: a first power distribution ring network cabinet, a second power distribution ring network cabinet, and a third power distribution ring network cabinet, and the m camera modules can include: a first camera module, a second camera module, and a third camera module, etc., which are not limited here; it can be known from Figure 2 that one camera module is arranged in each power distribution ring network cabinet, and each camera module is used to collect color images inside the corresponding power distribution ring network cabinet in real time, capturing visual features (such as strong light and color mutation) of possible arc faults; the controller can communicate and / or be physically connected with each camera model in the m camera modules, the controller can receive data collected by the m camera modules and issue instructions; when arc fault diagnosis is needed, the controller can execute the arc fault diagnosis method based on images provided by the embodiment of the present application, as follows: acquire color images of the m power distribution ring network cabinets through the m camera modules to obtain first color image data; perform preprocessing on the first color image data to obtain second color image data; label each data in the second color image data with a corresponding fault type and spatial coordinates of the fault type to obtain a labeled data set; train an initial machine learning model based on the labeled data set to obtain a target machine learning model; acquire a color image to be diagnosed; input the color image to be diagnosed into the target machine learning model to obtain a target diagnosis result; the target diagnosis result includes a target fault type and spatial coordinates corresponding to the target fault type; the target fault type includes one of the following: no fault, phase-to-phase arc fault, single-phase grounding arc fault, virtual contact arc fault, and switch breakdown arc fault.
[0033] It should be explained that the controller can also perform part or all of the steps of the image-based arc fault diagnosis method provided in the embodiments of the present application.
[0034] Please refer to Figure 3 , Figure 3 is a flowchart of an image-based arc fault diagnosis method provided in the embodiments of the present application; the method is applied to a controller in an arc fault diagnosis system, the arc fault diagnosis system further includes m power distribution ring network cabinets and m camera modules, one camera module is arranged in each power distribution ring network cabinet, m is a positive integer, and the method can include the following steps: S301, acquire color images of the m power distribution ring network cabinets through the m camera modules to obtain first color image data.
[0035] In the embodiments of the present application, in each power distribution ring network cabinet, the corresponding camera module is fixed near a key fault point (for example, a switch contact point, a conductor joint, or a busbar connection point), and is installed in a support or magnetic attraction manner to ensure that the lens of the camera module is directed to a high-fault area, for example, the switch opening and closing action and the joint contact point are completely in the center of the field of view by adjusting the angle; the camera module can be powered by a direct current power supply in the power distribution ring network cabinet, or powered by an Ethernet power supply to simplify wiring; in addition, the camera module can be connected to an edge computing device (or a transmission module) through an Ethernet interface, upload the collected image data to the edge computing device (or the transmission module) in real time, and then transmit the image data to the controller by the edge computing device (or the transmission module).
[0036] It should be explained that, unless otherwise specified, the images mentioned in the embodiments of the present application are all color images.
[0037] In specific embodiments, when the power distribution ring cabinet is in normal operation (no fault simulation), the m camera modules are controlled to collect images once every fixed period (such as every 5 minutes), or triggered collection (such as when current / voltage fluctuations are detected), to accumulate image samples of the normal working condition, to obtain normal image data. In addition, the m power distribution ring cabinets can be controlled to simulate faults, and the m camera modules are controlled to collect images during the simulation to obtain fault image data. Specifically, a typical arc fault (for example, an arc fault, a single-phase grounding arc fault, a virtual contact arc fault, a switch breakdown arc fault, etc.) can be artificially created, and each type of arc fault can be simulated multiple times. In each simulation, the camera module continuously collects at a high frame rate, for example, the camera module continuously collects at 30 fps for 5 seconds, covering the entire process from the generation to the development and final extinction of the arc, to obtain an image sequence containing the dynamic characteristics of the fault, and to obtain fault image data. The normal image data and the fault image data constitute the first color image data.
[0038] S302, pre-processing the first color image data to obtain second color image data.
[0039] In the embodiments of the present application, the pre-processing can include at least one of Gaussian filtering, median filtering, bilateral filtering, histogram equalization, brightness normalization, size adjustment, etc., without limitation.
[0040] In specific embodiments, the pre-processing can include bilateral filtering, histogram equalization, size adjustment, etc. Specifically, the first color image data can be processed using a bilateral filtering method, which considers both spatial distance and pixel value similarity, while smoothing noise and preserving arc edge texture. Next, the first color image data can be processed using adaptive histogram equalization to enhance contrast in blocks, avoiding overexposure caused by global equalization (such as the arc region being too bright and losing details). Then, the image format of the first color image data can be unified to ensure that the size and color channels of all pre-processed images are consistent, facilitating batch processing by the model. In this way, the second color image data can be obtained.
[0041] S303, labeling each data in the second color image data with its corresponding fault type and the spatial coordinates of the fault type to obtain a labeled data set.
[0042] In the embodiments of the present application, for each data in the second color image data, its corresponding fault type and the spatial coordinates of the fault type can be labeled, thereby obtaining a labeled data set.
[0043] Optionally, the second color image data includes a color image, and a is an integer greater than or equal to m; please refer to Figure 4 , Figure 4is a flowchart of a method for obtaining a labeled data set provided by an embodiment of the present application. As can be seen, step S303, the second color image data is labeled to obtain a labeled data set, which can include steps as shown in Figure 4 S31, extract statistical feature data of each color image in the a color images in the RGB color channel to obtain a statistical feature data; each statistical feature data includes at least one of the following: mean, variance, pixel distribution information, brightness mutation information; S32, according to the preset labeling rule, each data of the a statistical feature data is labeled with its corresponding fault type and the spatial coordinates of the fault type, to obtain a fault type and a spatial coordinates; S33, according to the a labeled type, the a spatial coordinates and the a color image, the labeled data set is determined.
[0044] In an embodiment of the present application, the preset labeling rule can be preset or default.
[0045] In a specific embodiment, the statistical feature data of each color image in the a color images in the RGB color channel can be extracted first to obtain a statistical feature data. Specifically, for each color image, after separating the RGB channel, the mean (reflecting the overall brightness) and variance (reflecting the dispersion degree of pixel distribution, such as the high brightness area of the arc will increase the variance) of each channel are calculated. Then, the pixel distribution information of each channel of RGB (such as the R channel histogram of the arc will have a significant peak in the high brightness interval) can be calculated through the histogram. In addition, if the a color images are image sequences, i.e. continuous frames taken during the arc generation process, the a color images can be arranged in the order of the shooting time before and after. The brightness mutation (obvious brightness jump will occur when the arc is generated) can be calculated by frame difference. If the a color images are not continuous frames but are taken separately, the brightness mutation information can be obtained by comparing the a color images with the preset color image (i.e. the color image under normal circumstances). In this way, the a statistical feature data can be obtained.
[0046] Then, each data of the a statistical feature data can be labeled according to the preset labeling rule with its corresponding fault type and the spatial coordinates of the fault type to obtain a fault type and a spatial coordinates. For example, the preset labeling rule can be as shown in Table 1: Table 1
[0047] Of course, the a statistical feature data can also be manually labeled to obtain a fault type and a spatial coordinates. Finally, the a labeled type, the a spatial coordinates and the a color image can be associated one by one to obtain a labeled data set.
[0048] The preset labeling rule is formulated in combination with the RGB feature rule of the arc fault (such as different fault types corresponding to different channel mean value ranges and variance threshold values). The statistical feature data is labeled by using the preset labeling rule, so that a certain degree of automation is realized, and the workload of manual labeling is greatly reduced. Especially when the number of samples is large, the labeling efficiency can be significantly improved.
[0049] In addition, by directly associating the statistical feature data with the visual essence of the fault type, the labeled data set can enable the machine learning model to more efficiently learn the mapping relationship between the features and the fault type. The model does not need to re-extract the underlying features from the original image, but can directly train based on these high-dimensional and targeted statistical features, thereby accelerating the model convergence speed and improving the training efficiency.
[0050] S304, training an initial machine learning model based on the labeled data set to obtain a target machine learning model.
[0051] Optionally, please refer to Figure 5 , Figure 5 is a flowchart of a method for obtaining a target machine learning model provided by the embodiments of the present application. As can be known, step S304, training an initial machine learning model based on the labeled data set to obtain a target machine learning model, can include the steps shown in Figure 5 . A1, dividing the data in the labeled data set into a training data set and a test data set; A2, training the initial machine learning model by using the training data set to obtain a first machine learning model; A3, testing the first machine learning model by using the test data set to obtain a test result; determining a first accuracy rate corresponding to the test result; A4, when the first accuracy rate is greater than a preset accuracy rate, determining the target machine learning model according to the first machine learning model; A5, when the first accuracy rate is not greater than the preset accuracy rate, obtaining new training data, training the first machine learning model by using the new training data, until the accuracy rate corresponding to the first machine learning model is greater than the preset accuracy rate, and determining the target machine learning model according to the first machine learning model.
[0052] In the embodiments of the present application, the preset accuracy rate can be preset or defaulted in advance.
[0053] In specific embodiments, the data in the labeled data set can be divided into a training data set and a test data set first, for example, all the data in the labeled data set can be sorted by time (such as by collection time from early to late), then a division point is set (such as taking 80% of the total data amount as a boundary), the first 80% of the data is taken as the training data set, and the last 20% of the data is taken as the test data set.
[0054] Then, the initial machine learning model can be trained using the training data set to obtain a first machine learning model; next, the first machine learning model can be tested using the test data set to obtain a test result; the first accuracy corresponding to the test result is determined, specifically, the test data set can be input into the first machine learning model to obtain the test result, the number of test results that are correct is found out to obtain a first number, then the total number of test results can be determined, and the first accuracy is obtained by dividing the first number by the total number; when the first accuracy is greater than a preset accuracy, it means that the first machine learning model is qualified, and the first machine learning model can be directly taken as the target machine learning model.
[0055] When the first accuracy is not greater than the preset accuracy, new training data can be obtained, the first machine learning model can be trained through the new training data until the accuracy corresponding to the first machine learning model is greater than the preset accuracy, then the first machine learning model can be taken as the target machine learning model.
[0056] In this way, the initial machine learning model is trained through the training data set, so that the initial machine learning model can learn the visual rules of arc faults (for example, the association between the RGB channel mean and the fault type).
[0057] Optionally, the training data set includes b color images, b is a positive integer less than a, and step A2 includes the following steps of: B1, extracting statistical feature data and color space position feature data of each color image in the b color images in the RGB color channel to obtain b statistical feature data and b color space position feature data; B2, determining b feature vectors corresponding to the b statistical feature data and the b color space position feature data; each feature vector corresponds to a statistical feature data and a color space position feature data; B3, dividing the b feature vectors into a training subset and a validation subset; B4, initializing the initial model parameters of the initial machine learning model; B5, fitting and training the initial machine learning model using the training subset; B6, verifying the initial machine learning model by using the verification subset to obtain a verification result; B7, determining whether the initial machine learning model meets a preset condition according to the verification result; B8, when the initial machine learning model meets the preset condition, determining the first machine learning model according to the initial machine learning model; B9, when the initial machine learning model does not meet the preset condition, optimizing the initial model parameter based on a preset search method to obtain a first model parameter; adjusting the model parameter of the initial machine learning model to the first model parameter to obtain a second machine learning model; obtaining a new training subset and a new verification subset, training the second machine learning model by using the new training subset and the new verification subset until the second machine learning model meets the preset condition, and determining the first machine learning model according to the second machine learning model.
[0058] In the embodiments of the present application, the preset condition and the preset search method can be preset or defaulted in advance; the color space position feature data can include at least one of the following: spatial coordinates of a key color region (for example, the coordinates of the bounding box of a highlight color region), spatial distribution of a color gradient, multi-channel color space correlation (for example, the ratio between the average value of the R channel and the average value of the B channel at the same position), and the like, which are not limited herein; the model parameter can include at least one of the following: a weight parameter, a bias parameter, a hyperparameter, and the like, which are not limited herein.
[0059] In specific embodiments, statistical feature data and color space position feature data of each color image in the b color images in the RGB color channel are extracted, obtaining b statistical feature data and b color space position feature data. Specifically, the method for obtaining b statistical feature data can be the same as the method for obtaining a statistical feature data. Then, for each color image in the b color images, the image can be first divided into regular grid regions or color-based clustering regions, and each region is labeled to provide a basis for subsequent feature association with spatial positions. For example, the image (assuming the image size is HxW) is uniformly divided into NxM sub-regions (such as 16x16, the sub-region size is hxw, h=H / 16, w=W / 16), and each sub-region is labeled with the coordinates of its center position. For another example, the RGB values of the image pixels can be K-means clustered (K=5-10), and pixels with similar colors are clustered into the same region, and the contour detection is used to obtain the bounding box coordinates of each clustering region. Then, for each divided region, the statistical features of the RGB channel can be calculated and bound with the spatial coordinates of the region, thereby obtaining the color space position feature data. For example, the color space position feature data can include the spatial coordinates of the key color region. Then, the regions that meet the arc feature (for example, high-intensity regions with R channel mean>200 and G channel mean>150) can be screened out by a preset color threshold, and their spatial coordinates are extracted to obtain the color space position feature data. In this way, b color space position feature data can be obtained.
[0060] Furthermore, b feature vectors corresponding to b statistical feature data and b color space position feature data can be determined. Specifically, since the dimensions of the statistical feature data and the color space position feature data are quite different, the b statistical feature data and the b color space position feature data can be standardized first, and then the feature dimensions of the b color space position feature data can be aligned. Specifically, for each color space position feature data, only feature data corresponding to a preset number of key areas can be retained. For example, assuming that the preset number is equal to 5, if the number of key areas in a certain color space position feature data is less than the preset number, the insufficient part is filled with a zero vector; if it is greater than 5, only the first 5 areas with the largest area are retained to ensure that the coordinate feature dimension is fixed; then, the standardized and dimensionally aligned statistical features and color space position features can be spliced in a fixed order to form a feature vector of a single sample. For example, assuming that the standardized data of a certain statistical feature data is [0.1, 0. 3,0.1], 0.1 corresponds to the mean of the R channel, 0.3 corresponds to the mean of the G channel, and 0.1 corresponds to the mean of the B channel. A certain color space position feature data includes feature data of 7 key areas (because there are multiple highlight areas around the arc). The feature data of each area include: bounding box coordinates (4 values), center of mass coordinates (2 values), and area (1 value), that is, each area corresponds to 7 eigenvalues. The areas of these 7 key areas are calculated, and the top 5 with the largest areas are taken (the area is an intuitive reflection of the arc energy, and the area with a large area is more likely to be the core fault area). The remaining 2 areas are discarded and not included in the feature data. The features of the 5 areas are retained, and the total dimension is 35 (which can be a fixed dimension preset in advance). The statistical feature data and the color space position feature data are spliced together in the order of "statistical feature-color space position feature". The statistical feature before splicing has 3 dimensions, the color space position feature has 35 dimensions, and the feature vector dimension after splicing is 38 dimensions. In this way, b feature vectors can be obtained.
[0061] Next, the b feature vectors can be divided into training subsets and validation subsets. Specifically, 80% of the b feature vectors can be divided into training subsets and the remaining 20% can be divided into validation subsets by random division. The initial model parameters of the initial machine learning model can be initialized. Specifically, zero initialization or small random number initialization can be used to initialize the initial model parameters. For example, zero initialization is to set the initial model parameters to 0 (simple and direct, suitable for linear models). For example, small random number initialization is to randomly sample from a normal distribution with a mean of 0 and a small variance (for example, (0, 0.01)), and assign the sampled values to the initial model parameters to avoid extreme initial prediction values caused by excessive parameters.
[0062] Then, the initial machine learning model can be fitted and trained using the training subset. Specifically, the feature vectors in the training subset can be input into the initial machine learning model as model inputs, and the corresponding fault types and spatial coordinates can be used as true labels. The initial machine learning model can generate a prediction result based on the initial model parameters, which includes the predicted fault types and spatial coordinates. A loss value can be calculated by a preset loss function (e.g., cross-entropy loss function for classification tasks or mean square error loss function for positioning tasks) between the prediction result and the true labels. An optimizer (e.g., gradient descent, Adam, etc.) can be used to iteratively adjust the model parameters (i.e., initial model parameters) based on the gradient direction of the loss value, gradually reduce the loss value, and repeat the above process until the loss value of the training subset tends to be stable or reaches a preset number of iterations (e.g., 100 rounds), completing the fitting and training.
[0063] Then, the initial machine learning model can be fitted and trained using the training subset. Specifically, the feature vectors in the training subset can be input into the initial machine learning model as model inputs, and the corresponding fault types and spatial coordinates can be used as true labels. The initial machine learning model can generate a prediction result based on the initial model parameters, which includes the predicted fault types and spatial coordinates. A loss value can be calculated by a preset loss function (e.g., cross-entropy loss function for classification tasks or mean square error loss function for positioning tasks) between the prediction result and the true labels. An optimizer (e.g., gradient descent, Adam, etc.) can be used to iteratively adjust the model parameters (i.e., initial model parameters) based on the gradient direction of the loss value, gradually reduce the loss value, and repeat the above process until the loss value of the training subset tends to be stable or reaches a preset number of iterations (e.g., 100 rounds), completing the fitting and training.
[0064] When the initial machine learning model does not meet the preset condition, the initial model parameters can be optimized based on a preset search method to obtain first model parameters. Specifically, the initial model parameters can be searched using the preset search method to obtain optimal model parameters, i.e., the first model parameters. The preset search method can include one of the following: random search, grid search, etc. Further, the model parameters of the initial machine learning model can be adjusted to the first model parameters to obtain a second machine learning model. Finally, a new training subset and a new validation subset can be obtained, and the second machine learning model can be trained using the new training subset and the new validation subset until the second machine learning model meets the preset condition. The second machine learning model can be determined as the first machine learning model.
[0065] In this way, by extracting RGB statistical features (global color regularity, such as mean and variance) and color space position features (local space and color association, such as highlight area coordinates), and fusing them into a feature vector, the essential properties of arc faults (such as "R channel highlight at the joint") can be more comprehensively captured. Compared with a single feature, the fused feature contains more discriminative information, providing a more accurate learning basis for the model and improving the accuracy of fault recognition and positioning from the source.
[0066] Optional, see Figure 6 , Figure 6 This is a flow chart of a method for obtaining an initial machine learning model provided in an embodiment of the present application. It can be seen that the method may also include Figure 6 Steps shown: C1. Obtain target recognition requirement parameters; C2. Selecting a machine learning model from the initial machine learning model library according to the target identification requirement parameters to obtain c machine learning models; c is an integer greater than 1; C3. Determine the computing power requirement corresponding to each of the c machine learning models to obtain c computing power requirements; C4. Obtaining target device performance parameters corresponding to the controller; C5. Determine the target computing power requirement range corresponding to the target device performance parameters; C6. Determine the computing power requirements within the target computing power requirement range among the c computing power requirements, obtaining d computing power requirements; d is a positive integer less than or equal to c; C7. Determine the initial machine learning model based on the d computing power requirements and the c machine learning models.
[0067] In an embodiment of the present application, the initial machine learning model library includes a variety of different types of machine learning models, such as random forests, support vector machines, convolutional neural networks, etc., which are not limited here.
[0068] In a specific embodiment, target identification requirement parameters can be obtained. Specifically, a requirement survey form can be designed and sent to the user for filling in. The target identification requirement parameters are determined based on the content filled in by the user. For example, the requirement survey form may include questions such as "What is the expected fault identification accuracy rate you hope to achieve?", which are not limited here. Alternatively, the user can manually input the target identification requirement parameters into the controller. For example, if the user requires "accuracy of 98% and inference delay of 50ms", the target identification requirement parameters are: accuracy greater than or equal to 98%, and inference delay less than or equal to 50ms.
[0069] Next, a machine learning model can be selected from the initial machine learning model library according to the target recognition requirement parameters to obtain c machine learning models. For example, assuming that the target recognition requirement parameter is an accuracy greater than or equal to 98%, the maximum accuracy of each model in the initial machine learning model library can be obtained to obtain multiple maximum accuracy rates. Then, a maximum accuracy rate greater than 98% is selected from these multiple maximum accuracy rates to obtain c maximum accuracy rates. The models corresponding to these c maximum accuracy rates in the initial machine learning model library are selected to obtain c machine learning models.
[0070] Then, the computing power requirement corresponding to each of the c machine learning models can be determined, and c computing power requirements are obtained. Specifically, a mapping relationship between preset machine learning models and computing power requirements can be pre-stored, and the c computing power requirements corresponding to the c machine learning models are determined based on the mapping relationship. Then, the target device performance parameter corresponding to the controller can be obtained. Specifically, the target device model corresponding to the controller can be obtained first, and the target device performance parameter is determined according to the target device model. For example, a mapping relationship between preset device models and device performance parameters can be pre-stored, and the target device performance parameter corresponding to the target device model is determined based on the mapping relationship. It should be explained that the target device performance parameter includes at least one of the following: processor model, core number, base frequency, etc., which are not limited here.
[0071] Further, the target computing power requirement range corresponding to the target device performance parameter can be determined. Specifically, the maximum computing power requirement that can be provided by the controller can be determined according to the target device performance parameter, and the target computing power requirement range is from zero to the maximum computing power requirement. Then, the computing power requirements in the c computing power requirements that are within the target computing power requirement range can be found, and d computing power requirements are obtained. Finally, the initial machine learning model is determined based on the d computing power requirements and the c machine learning models.
[0072] In this way, the core performance indicators that the model needs to meet are determined through the target recognition requirement parameter; the c machine learning models are selected based on the target recognition requirement parameter (such as a complex model corresponding to a high accuracy requirement, and a lightweight model corresponding to a real-time requirement), which ensures that the c machine learning models are all based on the premise of “meeting the actual recognition requirement”, and avoids selecting models that are irrelevant to the demand target.
[0073] Optionally, in step C7, the initial machine learning model is determined based on the d computing power requirements and the c machine learning models, including: D1, determining d machine learning models corresponding to the d computing power requirements in the c machine learning models; D2, obtaining historical usage data corresponding to each of the d machine learning models, and obtaining d historical usage data; D3, determining a reference model score corresponding to each of the d historical usage data, and obtaining d reference model scores; D4, determining a fine-tuning factor corresponding to each of the d computing power requirements, and obtaining d fine-tuning factors; D5, fine-tuning the corresponding reference model score in the d reference model scores according to the d fine-tuning factors, and obtaining d target model scores; D6, determine the maximum score in the d target model scores, and determine the corresponding machine learning model in the d machine learning models as the initial machine learning model.
[0074] In the embodiments of the present application, d machine learning models corresponding to d computing power requirements can be found in c machine learning models. Then, the historical use data corresponding to each machine learning model in the d machine learning models can be obtained, and d historical use data can be obtained. Specifically, the use records of each machine learning model in the d machine learning models can be queried from a preset database, and the extracted use records can be grouped according to the model unique identifier (for example, model ID) to ensure that the data of each model is independently grouped, and finally d use records, that is, d historical use data, can be obtained. For example, the historical data of model A includes "model training duration of 30 days, accuracy of 96% in XX ring network cabinet in January 2024, false positive rate of 2%, and average delay of 80ms"; the historical data of model B includes "model training duration of 10 days, accuracy of 94% in YY ring network cabinet in June 2024, and precision decrease of 5% in electromagnetic interference test".
[0075] Then, the reference model score corresponding to each historical use data in the d historical use data can be determined, and d reference model scores can be obtained. Then, the fine tuning factor corresponding to each computing power requirement in the d computing power requirements can be determined, and d fine tuning factors can be obtained. For example, a mapping relationship between the preset computing power requirement and the fine tuning factor can be stored in advance, and the d fine tuning factors corresponding to the d computing power requirements can be determined based on the mapping relationship. The value range of each fine tuning factor is -0.15~0.15. Further, the corresponding reference model score in the d reference model scores can be fine tuned according to the d fine tuning factors, and d target model scores can be obtained. Specifically as follows: The first target model score = the first reference model score × (1 + the first fine tuning factor); Wherein, the first reference model score is any reference model score in the d reference model scores; the first fine tuning factor is the fine tuning factor corresponding to the first reference model score in the d fine tuning factors; the first target model score is the target model score corresponding to the first reference model score in the d target model scores; d times of calculation can be performed according to the above formula to obtain d target model scores; then, the d target model scores can be compared with each other to find the maximum score, and the machine learning model corresponding to the maximum score in the d machine learning models is determined as the initial machine learning model.
[0076] Thus, by scoring according to the d historical usage data, d reference model scores are obtained, and the past actual performance of the model (for example, accuracy rate, false alarm rate, anti-interference ability in the same type of ring network cabinet) is quantified as a score. Compared with only relying on theoretical performance (such as the accuracy upper limit of the model design), historical usage data can better reflect the stability of the model in real scenarios (such as whether the accuracy drops sharply in a high-temperature environment), making the evaluation closer to the actual application requirements and reducing the probability of selecting a model that is excellent in theory but collapses in practice.
[0077] Optionally, each historical usage data includes: training duration, accuracy rate, inference delay; step D3, the determining of the reference model score corresponding to each historical usage data in the d historical usage data to obtain d reference model scores, includes: E1, obtaining first historical usage data; the first historical usage data is any historical usage data in the d historical usage data; the first historical usage data includes: first training duration, first accuracy rate, and first inference delay; E2, determining the reference accuracy rate and the reference inference delay corresponding to the target identification requirement parameter; E3, determining the difference between the first accuracy rate and the reference accuracy rate to obtain a target accuracy rate difference; E4, determining a first model score corresponding to the target accuracy rate difference; E5, determining the difference between the first inference delay and the reference inference delay to obtain a target inference delay difference; E6, determining a second model score corresponding to the target inference delay difference; E7, determining a third model score according to the first model score and the second model score; E8, determining a target score influence factor corresponding to the first training duration; E9, adjusting the third model score according to the target score influence factor to obtain a reference model score corresponding to the first historical usage data.
[0078] In the embodiments of the present application, the first historical use data can be acquired first; then, the reference accuracy and the reference inference delay corresponding to the target recognition demand parameter can be determined, for example, assuming that the target recognition demand parameter is: the accuracy is greater than or equal to 98% and the inference delay is less than or equal to 50 ms, the minimum requirement corresponding to the target recognition demand parameter can be taken as the reference accuracy and the reference inference delay, that is, the reference accuracy is equal to 98% and the reference inference delay is equal to 50 ms; then, the first accuracy minus the reference accuracy can be used to obtain the target accuracy difference; then, the first model score corresponding to the target accuracy difference can be determined, specifically, a preset mapping relationship between the accuracy difference and the model score can be pre-stored, and the first model score corresponding to the target accuracy difference can be determined based on the mapping relationship; Then, the first inference delay minus the reference inference delay can be used to obtain the target inference delay difference; then, the second model score corresponding to the target inference delay difference can be determined, for example, a preset mapping relationship between the inference delay difference and the model score can be pre-stored, and the second model score corresponding to the target inference delay difference can be determined based on the mapping relationship; further, the third model score can be determined according to the first model score and the second model score, specifically, the first model score and the second model score can be directly added to obtain the third model score, or the first weight corresponding to the first model score (since the arc fault diagnosis, the false negative may cause a safety accident, and more attention needs to be paid to the accuracy, therefore the first weight can be allocated higher, for example, 0.7) and the second weight corresponding to the second model score (for example, 0.3) can be determined, the sum of the first weight and the second weight is 1, and the third model score is obtained by weighted operation according to the first weight, the second weight, the first model score and the second model score.
[0079] Then, the target score influence factor corresponding to the first training duration can be determined, specifically, a preset mapping relationship between the training duration and the score influence factor can be pre-stored, and the target score influence factor corresponding to the first training duration can be determined based on the mapping relationship, wherein the value range of the target score influence factor can be-0.2~0.2; finally, the third model score can be adjusted according to the target score influence factor, specifically as follows: The fourth model score = the third model score x (1+the target score influence factor); According to the above formula, the fourth model score, that is, the reference model score corresponding to the first historical use data, can be obtained.
[0080] In this way, by determining the third model score according to the first model score and the second model score, the performance of the accuracy and the inference delay is integrated into a comprehensive score, the comprehensive score realizes the balanced evaluation of “accuracy” and “real-time”, and can comprehensively reflect the adaptability of the model in the actual scene.
[0081] S305, acquire a color image to be diagnosed.
[0082] In the embodiment of the application, m camera modules can be used to collect color images of m power distribution ring network cabinets to obtain multiple color images, and the controller selects one color image from the multiple color images as the color image to be diagnosed, or the user can manually input the color image to be diagnosed to the controller.
[0083] S306, input the color image to be diagnosed into the target machine learning model to obtain a target diagnosis result; the target diagnosis result includes a target fault type and a spatial coordinate corresponding to the target fault type; the target fault type includes one of the following: no fault, phase-to-phase arc fault, single-phase ground arc fault, virtual contact arc fault, and switch breakdown arc fault.
[0084] In the embodiment of the application, the color image to be diagnosed can be input into the target machine learning model, and the target machine learning model can infer and predict according to the color image to be diagnosed to obtain the target fault type and the spatial coordinate corresponding to the target fault type, i.e., the target diagnosis result.
[0085] In summary, the image-based arc fault diagnosis method described in the application uses m camera modules as core perception devices. The camera module is a mature mass-produced device, and the cost of a single device is much lower than that of a high-precision sensor (such as a very high frequency sensor or an infrared thermal imager) relied on by a traditional arc detection. Therefore, the detection cost is greatly reduced. In addition, the target machine learning model can diagnose and infer the color image to be diagnosed, which can quickly and accurately obtain the detection result, improve the real-time performance of arc fault detection, and realize low-cost and high-real-time arc fault detection through the method.
[0086] Please refer to Figure 7 , Figure 7 is a functional unit composition block diagram of an image-based arc fault diagnosis apparatus 700 provided by an embodiment of the application. The image-based arc fault diagnosis apparatus 700 is applied to a controller in an arc fault diagnosis system, and the arc fault diagnosis system further includes m power distribution ring network cabinets and m camera modules. One camera module is arranged in each power distribution ring network cabinet, m is a positive integer, and the image-based arc fault diagnosis apparatus 700 includes an acquisition unit 701, a model training unit 702, and a diagnosis unit 703. The acquisition unit 701 is configured to collect color images of the m power distribution ring network cabinets through the m camera modules to obtain first color image data. The model training unit 702 is configured to pre-process the first color image data to obtain second color image data, label each data in the second color image data with a corresponding fault type and a spatial coordinate of the fault type to obtain a labeled data set, train an initial machine learning model based on the labeled data set, and obtain a target machine learning model. The acquisition unit 701 is further configured to acquire a color image to be diagnosed. The diagnosis unit 703 is configured to input the color image to be diagnosed into the target machine learning model to obtain a target diagnosis result, wherein the target diagnosis result includes a target fault type and a spatial coordinate corresponding to the target fault type, and the target fault type includes one of the following: no fault, inter-phase arc fault, single-phase ground arc fault, virtual contact arc fault, and switch breakdown arc fault.
[0087] In specific implementations, the image-based arc fault diagnosis apparatus 700 described in the embodiments of the present application can also perform other implementations described in the image-based arc fault diagnosis method provided by the embodiments of the present application, which will not be described here again.
[0088] Please refer to Figure 8 , Figure 8 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. The electronic device can include a processor, a memory, a communication interface, and one or more programs. The processor, the memory, and the communication interface can be connected to each other through a bus. The one or more programs are stored in the memory and are configured to be executed by the processor. In the embodiment of the present application, the electronic device is applied to a controller in an arc fault diagnosis system. The arc fault diagnosis system further includes m power distribution ring network cabinets and m camera modules. One camera module is arranged in each power distribution ring network cabinet. m is a positive integer. The program includes instructions for performing the following steps: acquire color images of the m power distribution ring network cabinets through the m camera modules to obtain first color image data; pre-process the first color image data to obtain second color image data; label each data in the second color image data with a corresponding fault type and a spatial coordinate of the fault type to obtain a labeled data set; train an initial machine learning model based on the labeled data set to obtain a target machine learning model; acquire a color image to be diagnosed; Input the color image to be diagnosed into the target machine learning model to obtain a target diagnosis result; the target diagnosis result includes a target fault type and a spatial coordinate corresponding to the target fault type; the target fault type includes one of the following: no fault, inter-phase arc fault, single-phase ground arc fault, virtual contact arc fault, and switch breakdown arc fault.
[0089] It should be explained that the electronic device can also perform part or all of the steps of any of the methods described in the above method embodiments.
[0090] The embodiments of the present application also provide a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to perform part or all of the steps of any of the methods described in the above method embodiments, and the computer includes the electronic device.
[0091] The embodiments of the present application also provide a computer program product, which includes a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform part or all of the steps of any of the methods described in the above method embodiments. The computer program product can be a software installation package, and the computer includes the electronic device.
[0092] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other order or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0093] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0094] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the above units is only a logical function division. There can be another division manner for actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical or other forms.
[0095] Those skilled in the art can understand that all or part of the processes in the above-mentioned method embodiments can be implemented by a computer program instructing relevant hardware, and the program can be stored in a computer-readable storage medium, and when executed, the program can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: ROM, random access memory (RAM), magnetic disk, optical disk, and various storage media that can store program codes.
[0096] The steps of the method or algorithm described in the embodiments of the present application can be implemented in the form of hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, EPROM, electrically EPROM (EEPROM), register, hard disk, mobile hard disk, compact disc read-only memory (CD-ROM), or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device or a management device. Of course, the processor and the storage medium can also exist as discrete components in the terminal device or the management device.
[0097] Those skilled in the art should realize that, in one or more examples described above, the functions described in the embodiments of the present application can be implemented entirely or partially by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product entirely or partially. The computer program product includes one or more computer instructions. When loaded and executed on a computer, the computer program instructions entirely or partially generate the processes or functions described in the embodiments of the present application.
[0098] The above-mentioned computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer instructions can be transferred from one website, computer, server, or data center to another via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media sets.
[0099] Among them, the available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
[0100] The various modules / units included in the various devices and products described in the above embodiments can be software modules / units or hardware modules / units, or can be partially software modules / units and partially hardware modules / units. For example, for the various devices and products applied to or integrated into a chip, the various modules / units included therein can all be implemented in the form of hardware such as circuits, or at least some of the modules / units can be implemented in the form of software programs running on a processor integrated in the chip, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for the various devices and products applied to or integrated into a chip module, the various modules / units included therein can all be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, a chip, a circuit module, etc.) or different components of the chip module, or at least some of the modules / units can be implemented in the form of software programs running on a processor integrated in the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for the various devices and products applied to or integrated into a terminal device, the various modules / units included therein can all be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, a chip, a circuit module, etc.) or different components of the terminal device, or at least some of the modules / units can be implemented in the form of software programs running on a processor integrated in the terminal device, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.
[0101] The above detailed description of the specific implementation is further detailed for the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only a specific implementation of the embodiments of the present application and is not intended to limit the protection scope of the embodiments of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the embodiments of the present application shall be included in the protection scope of the embodiments of the present application.
Claims
1. An image-based arc fault diagnosis method, characterized in that: A controller applied to an arc fault diagnosis system, wherein the arc fault diagnosis system further comprises m power distribution ring network cabinets and m camera modules, each power distribution ring network cabinet is provided with a camera module, and m is a positive integer. The method comprises: Collecting color images of the m power distribution ring network cabinets through the m camera modules to obtain first color image data; preprocessing the first color image data to obtain second color image data; labeling each data in the second color image data with its corresponding fault type and the spatial coordinates of the fault type to obtain a labeled data set; Training an initial machine learning model based on the labeled data set to obtain a target machine learning model; Acquire a color image to be diagnosed; The color image to be diagnosed is input into the target machine learning model to obtain a target diagnosis result; the target diagnosis result includes a target fault type and the spatial coordinates corresponding to the target fault type; the target fault type includes one of the following: no fault, phase-to-phase arc fault, single-phase grounding arc fault, virtual contact arc fault, and switch breakdown arc fault.
2. The method according to claim 1, wherein The second color image data includes a color images, where a is an integer greater than or equal to m; and the labeling of the second color image data to obtain a labeling dataset includes: Extracting statistical feature data of each color image in the RGB color channel of the a color images to obtain a statistical feature data; each statistical feature data includes at least one of the following: mean, variance, pixel distribution information, and brightness mutation information; Label each of the a statistical feature data with its corresponding fault type and the spatial coordinates of the fault type according to a preset labeling rule, to obtain a fault type and a spatial coordinates; The annotation data set is determined according to the a annotation types, the a spatial coordinates, and the a color images.
3. The method according to claim 1 or 2, wherein: The step of training an initial machine learning model based on the labeled data set to obtain a target machine learning model includes: Dividing the data in the labeled dataset into a training dataset and a test dataset; Training the initial machine learning model using the training data set to obtain a first machine learning model; Testing the first machine learning model using the test data set to obtain a test result; and determining a first accuracy rate corresponding to the test result; When the first accuracy rate is greater than a preset accuracy rate, determining the target machine learning model according to the first machine learning model; When the first accuracy rate is not greater than the preset accuracy rate, new training data is obtained, and the first machine learning model is trained using the new training data until the accuracy rate corresponding to the first machine learning model is greater than the preset accuracy rate, and the target machine learning model is determined based on the first machine learning model.
4. The method according to claim 3, wherein The training data set includes b color images, where b is a positive integer less than a. The initial machine learning model is trained using the training data set to obtain a first machine learning model, including: Extracting statistical feature data and color space position feature data on the RGB color channels of each color image in the b color images to obtain b statistical feature data and b color space position feature data; Determine b feature vectors corresponding to the b statistical feature data and the b color space position feature data; each feature vector corresponds to one statistical feature data and one color space position feature data; Dividing the b feature vectors into a training subset and a validation subset; Initializing initial model parameters of the initial machine learning model; Performing fitting training on the initial machine learning model using the training subset; Validating the initial machine learning model using the validation subset to obtain a validation result; Determining whether the initial machine learning model meets preset conditions according to the verification result; When the initial machine learning model meets the preset condition, determining the first machine learning model according to the initial machine learning model; When the initial machine learning model does not meet the preset conditions, the initial model parameters are optimized based on a preset search method to obtain first model parameters; the model parameters of the initial machine learning model are adjusted to the first model parameters to obtain a second machine learning model; a new training subset and a new validation subset are obtained, and the second machine learning model is trained with the new training subset and the new validation subset until the second machine learning model meets the preset conditions, and the first machine learning model is determined based on the second machine learning model.
5. The method according to claim 1 or 2, wherein: The method further comprises: Obtain target identification requirement parameters; Selecting a machine learning model from an initial machine learning model library according to the target identification requirement parameters to obtain c machine learning models; c is an integer greater than 1; Determine the computing power requirement corresponding to each of the c machine learning models to obtain c computing power requirements; Obtaining target device performance parameters corresponding to the controller; Determine the target computing power requirement range corresponding to the target device performance parameters; Determine the computing power requirements within the target computing power requirement range among the c computing power requirements, obtaining d computing power requirements; d is a positive integer less than or equal to c; Determine the initial machine learning model based on the d computing power requirements and the c machine learning models.
6. The method according to claim 5, wherein The determining the initial machine learning model based on the d computing power requirements and the c machine learning models includes: Determine d machine learning models corresponding to the d computing power requirements among the c machine learning models; Obtain historical usage data corresponding to each of the d machine learning models to obtain d historical usage data; Determine a reference model score corresponding to each of the d historical usage data to obtain d reference model scores; Determine a fine-tuning factor corresponding to each of the d computing power requirements to obtain d fine-tuning factors; Fine-tune corresponding reference model scores among the d reference model scores according to the d fine-tuning factors to obtain d target model scores; Determine the maximum score among the d target model scores, and determine the machine learning model corresponding to the maximum score among the d machine learning models as the initial machine learning model.
7. The method according to claim 6, wherein Each historical usage data includes: training time, accuracy, and inference delay; determining the reference model score corresponding to each of the d historical usage data to obtain d reference model scores includes: Obtaining first historical usage data; the first historical usage data is any historical usage data among the d historical usage data; the first historical usage data includes: a first training duration, a first accuracy rate, and a first inference delay; Determining a reference accuracy and a reference inference delay corresponding to the target recognition requirement parameters; Determine a difference between the first accuracy rate and the reference accuracy rate to obtain a target accuracy rate difference; Determining a first model score corresponding to the target accuracy difference; determining a difference between the first inference delay and the reference inference delay to obtain a target inference delay difference; Determining a second model score corresponding to the target inference delay difference; determining a third model score based on the first model score and the second model score; Determining a target score influencing factor corresponding to the first training duration; The third model score is adjusted according to the target score influencing factor to obtain a reference model score corresponding to the first historical usage data.
8. An image-based arc fault diagnosis device, characterized in that: A controller used in an arc fault diagnosis system, wherein the arc fault diagnosis system further comprises m distribution ring network cabinets and m camera modules, each distribution ring network cabinet is provided with a camera module, and m is a positive integer. The device comprises: an acquisition unit, a model training unit, and a diagnosis unit, wherein: The acquisition unit is configured to acquire color images of the m power distribution ring network cabinets through the m camera modules to obtain first color image data; The model training unit is configured to preprocess the first color image data to obtain second color image data; label each data in the second color image data with its corresponding fault type and the spatial coordinates of the fault type to obtain a labeled data set; and train an initial machine learning model based on the labeled data set to obtain a target machine learning model; The acquisition unit is further used to obtain the color image to be diagnosed; The diagnostic unit is used to input the color image to be diagnosed into the target machine learning model to obtain a target diagnostic result; the target diagnostic result includes a target fault type and the spatial coordinates corresponding to the target fault type; the target fault type includes one of the following: no fault, phase-to-phase arc fault, single-phase grounding arc fault, virtual contact arc fault, and switch breakdown arc fault.
9. An electronic device, characterized in that: include: a processor, a memory, a communication interface, and one or more programs; The one or more programs are stored in the memory and configured to be executed by the processor, wherein the programs include instructions for executing the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Transformer photoelectric joint judgment arc alarm device and alarm criterion method
CN116908613A