Cable phase sequence identification method and device, computer program product and storage medium
Through the target recognition model, the ring cabinet image is labeled and multi-angle rotation and data enhancement processing are used to extract features and classify prediction, which solves the problem of low phase sequence recognition efficiency and poor robustness of ring cabinet cables, and achieves accuracy Identification and efficiency improvement.
Patent Information
- Application Number
- CN202411229932.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-20
AI Technical Summary
The phase sequence recognition of the cable of the central ring network cabinet in the prior art relies on manual detection, resulting in low recognition efficiency, poor robustness, and lack of effective solutions.
The target recognition model is used to identify the ring cabinet images, and the phase sequence of the cable is determined through multi-angle rotation, cropping, and data enhancement processing. The backbone network and the intermediate network are extracted, and the prediction layer is combined with the prediction layer to determine the phase sequence of the cable.
The accuracy and efficiency of cable phase sequence recognition are improved, the robustness of the identification method is improved, and the accurate identification of cable phase sequence in the ring cabinet image is achieved.
Smart Images

Figure CN119168973A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power detection technology, and in particular to a cable phase sequence identification method, device, computer program product, and storage medium. Background Art
[0002] In the construction acceptance of power grids, timely detection and elimination of hidden faults is one of the important links in power grid operation and maintenance. Due to the large number of ring main units and the uneven quality of construction personnel, installation errors or violations are very likely to occur, which in turn causes power line failures. Cable wiring errors are one of the common installation errors. Once cable wiring errors occur, they will lead to circuit phase sequence errors, which will cause equipment reversal, short circuit and other accidents.
[0003] At present, the construction acceptance of the ring main unit is usually carried out manually, that is, the acceptance personnel conduct on-site inspections to determine whether the ring main unit is installed correctly. However, the manual acceptance method makes it impossible to carry out the acceptance work quickly and efficiently.
[0004] In addition, in the early days, traditional image detection technology was mainly used to identify cables. By extracting features such as cable shape and color, and then using methods such as threshold segmentation to classify cables, and using various RGB thresholds to distinguish targets from backgrounds, and then using non-overlapping windows to compare texture features of patterns and targets, the minimum circumscribed rectangular frame was generated to identify cables. Although this method is more accurate in positioning, the horizontal width error of the cable detection frame obtained is large, which leads to poor robustness of this method.
[0005] From the above analysis, it can be seen that the method for identifying the phase sequence of the ring main unit cable provided by the above-mentioned prior art relies on manual detection and identification, resulting in low identification efficiency and poor robustness. No effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present invention provide a cable phase sequence identification method, device, computer program product, and storage medium to at least solve the technical problem that the ring network cabinet cable phase sequence identification method provided by the prior art relies on manual detection and identification, resulting in low identification efficiency and poor robustness.
[0007] According to one aspect of an embodiment of the present invention, a method for identifying a phase sequence of a cable is provided, comprising:
[0008] Acquire the image of the ring main unit to be identified; perform label recognition on the image of the ring main unit to be identified using the target recognition model to obtain a recognition result, wherein the target recognition model is used to recognize the label of the target cable in the image of the ring main unit to be identified; and determine the phase sequence of the target cable according to the recognition result.
[0009] Optionally, the above-mentioned cable phase sequence identification method also includes: collecting the original image data set of the ring network cabinet based on the target shooting device; rotating the original image data set at multiple angles to obtain a first image data set; cropping the images in the first image data set to multiple sizes to obtain a second image data set; adjusting the images in the second image data set to multiple parameters to obtain a sample image data set; performing data enhancement processing on the sample image data set using the target data enhancement method to obtain an image training set; extracting features from the image training set using the backbone network to obtain a first feature atlas; performing feature fusion on the first feature atlas using the intermediate network to obtain a second feature atlas; using the detection head of the prediction layer to perform classification prediction on the second feature atlas to obtain a prediction result, wherein the prediction result is used to determine the predicted label of any cable in any image of the second feature atlas; evaluating the model performance according to the predicted label to obtain an evaluation result, wherein the evaluation result is used to determine the label recognition accuracy; in response to the convergence of the label recognition accuracy obtained by multiple iterative training, the recognition model obtained by the last iterative training in the multiple iterative training is determined as the target recognition model.
[0010] Optionally, a target data enhancement method is used to perform data enhancement processing on a sample image data set to obtain an image training set, including: selecting any number of images from the sample image data set; performing geometric transformation and color space transformation on any number of images to obtain a plurality of first transformed images; splicing the plurality of first transformed images according to a preset splicing rule to obtain a spliced image; and constructing an image training set based on the plurality of spliced images.
[0011] Optionally, the backbone network includes a first network, a second network and a pooling layer, and the backbone network is used to extract features from the image training set to obtain a first feature atlas, including: using the first network to slice any image in the image training set to obtain multiple second transformed images; using the second network to perform step-by-step convolution and splicing on the multiple second transformed images to obtain a third feature atlas; using the pooling layer to perform cross-size feature detection and extraction on the third feature atlas to obtain the first feature atlas.
[0012] Optionally, the intermediate network includes a third network and a fourth network, and the intermediate network is used to perform feature fusion on the first feature atlas to obtain the second feature atlas, including: multiple upsampling of any image in the first feature atlas based on the third network to obtain a fifth feature atlas; and bottom-up feature fusion of the fifth feature atlas based on the fourth network to obtain the second feature atlas.
[0013] Optionally, the detection head includes a first detection branch, a second detection branch and a third detection branch, and the detection head of the prediction layer is used to perform classification prediction on the second feature atlas, and the prediction results obtained include: using the first detection branch to predict the position of any cable to obtain a target box, wherein the target box is used to locate the cable; using the second detection branch to predict the label category of any cable to obtain a category score; using the third detection branch to predict the confidence of any cable to obtain a confidence score; determining the predicted label of any cable based on the target box, category score and confidence score to obtain a prediction result.
[0014] Optionally, the model performance is evaluated according to the predicted labels, and the evaluation results include: judging the correctness of the predicted labels according to the true labels of any image in the second feature atlas, and obtaining a judgment result, wherein the judgment result includes the number of correct predicted labels and the number of incorrectly predicted labels corresponding to the second feature atlas; and calculating the label recognition accuracy using the number of correctly predicted labels and the number of incorrectly predicted labels to obtain an evaluation result.
[0015] According to another aspect of an embodiment of the present invention, a cable phase sequence identification device is provided, comprising:
[0016] An acquisition module is used to acquire the image of the ring main unit to be identified; an identification module is used to perform label identification on the image of the ring main unit to be identified using a target recognition model to obtain an identification result, wherein the target recognition model is used to identify the label of the target cable in the image of the ring main unit to be identified; and a determination module is used to determine the phase sequence of the target cable according to the identification result.
[0017] Optionally, the above-mentioned cable phase sequence identification device also includes: a training module, which is used to collect the original image data set of the ring network cabinet based on the target shooting device; rotate the original image data set at multiple angles to obtain a first image data set; crop the images in the first image data set to multiple sizes to obtain a second image data set; adjust the images in the second image data set to multiple parameters to obtain a sample image data set; use the target data enhancement method to perform data enhancement processing on the sample image data set to obtain an image training set; use the backbone network to extract features from the image training set to obtain a first feature atlas; use the intermediate network to perform feature fusion on the first feature atlas to obtain a second feature atlas; use the detection head of the prediction layer to classify and predict the second feature atlas to obtain a prediction result, wherein the prediction result is used to determine the predicted label of any cable in any image of the second feature atlas; evaluate the model performance according to the predicted label to obtain an evaluation result, wherein the evaluation result is used to determine the label recognition accuracy; in response to the convergence of the label recognition accuracy obtained by multiple iterative training, the recognition model obtained by the last iterative training in the multiple iterative training is determined as the target recognition model.
[0018] Optionally, the above-mentioned training module is also used for: the backbone network includes a first network, a second network and a pooling layer, and the backbone network is used to extract features from the image training set to obtain a first feature atlas, including: using the first network to slice any image in the image training set to obtain multiple second transformed images; using the second network to perform step-by-step convolution and splicing on the multiple second transformed images to obtain a third feature atlas; using the pooling layer to perform cross-size feature detection and extraction on the third feature atlas to obtain the first feature atlas.
[0019] Optionally, the above-mentioned training module is also used for: the intermediate network includes a third network and a fourth network, and the intermediate network is used to perform feature fusion on the first feature atlas to obtain the second feature atlas, including: multiple upsampling of any image in the first feature atlas based on the third network to obtain a fifth feature atlas; and bottom-up feature fusion of the fifth feature atlas based on the fourth network to obtain the second feature atlas.
[0020] Optionally, the above-mentioned training module is also used for: the detection head includes a first detection branch, a second detection branch and a third detection branch, and the detection head of the prediction layer is used to perform classification prediction on the second feature atlas, and the prediction results include: using the first detection branch to predict the position of any cable to obtain a target box, wherein the target box is used to locate the cable; using the second detection branch to predict the label category of any cable to obtain a category score; using the third detection branch to predict the confidence of any cable to obtain a confidence score; determining the predicted label of any cable based on the target box, category score and confidence score to obtain a prediction result.
[0021] Optionally, the above-mentioned training module is also used to: evaluate the model performance according to the predicted labels, and obtain the evaluation results including: judging the correctness of the predicted labels according to the true labels of any image in the second feature atlas, and obtaining the judgment results, wherein the judgment results include the number of correct predicted labels and the number of incorrectly predicted labels corresponding to the second feature atlas; using the number of correctly predicted labels and the number of incorrectly predicted labels to count the label recognition accuracy and obtain the evaluation results.
[0022] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above-mentioned cable phase sequence identification methods is implemented.
[0023] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, any one of the aforementioned cable phase sequence identification methods is implemented.
[0024] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any one of the aforementioned cable phase sequence identification methods.
[0025] In an embodiment of the present invention, the image of the ring network cabinet to be identified is first obtained, and then the target recognition model is used to perform label recognition on the image of the ring network cabinet to be identified to obtain a recognition result, wherein the target recognition model is used to identify the label of the target cable in the image of the ring network cabinet to be identified, and finally the phase sequence of the target cable is determined according to the recognition result. The target recognition model is obtained by constructing and training, and then the target recognition model is used to accurately detect small targets in the image of the ring network cabinet to be identified to accurately identify the label of the target cable in the image of the ring network cabinet to be identified, thereby determining the phase sequence of the target cable according to the label sequence, and achieving the purpose of accurately identifying the phase sequence of the cable in the image of the ring network cabinet, thereby achieving the technical effect of improving the accuracy and efficiency of cable phase sequence recognition and improving the robustness of the cable phase sequence recognition method, thereby solving the technical problem that the prior art provides a ring network cabinet cable phase sequence recognition method that relies on manual detection and recognition, resulting in low recognition efficiency and poor robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0027] Figure 1 is a hardware structure block diagram of an optional computing terminal for a cable phase sequence identification method according to an embodiment of the present invention;
[0028] Figure 2 is a flow chart of a cable phase sequence identification method according to an embodiment of the present invention;
[0029] Figure 3 is a schematic diagram of an improved image enhancement method according to an embodiment of the present invention;
[0030] Figure 4 is a structural block diagram of a cable phase sequence identification device according to an embodiment of the present invention;
[0031] Figure 5 is a schematic diagram of a feature fusion process in a backbone network according to an embodiment of the present invention;
[0032] Figure 6 is a schematic diagram of a feature fusion process in an intermediate network according to an embodiment of the present invention;
[0033] Figure 7 is a schematic diagram of an optional cable phase sequence identification result according to an embodiment of the present invention;
[0034] Figure 8 4 is a structural block diagram of a cable phase sequence identification device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. 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 should fall within the scope of protection of the present invention.
[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] According to an embodiment of the present invention, a method embodiment of a cable phase sequence identification method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] Figure 1 is a hardware structure block diagram of a computing terminal for a cable phase sequence identification method according to an embodiment of the present invention, such as Figure 1As shown, the computing terminal (or mobile device) may include one or more processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Microcontroller Unit, MCU) or a programmable logic device (FieldProgrammable Gate Array, FPGA)), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display device 110, an input and output device 108 (i.e., an IO device), a Universal Serial Bus (USB) port (which may be included as one of the ports of a computer bus, not shown in the figure), a network interface (not shown in the figure), a power supply (not shown in the figure) and / or a camera (not shown in the figure). It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above computing terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0039] It should be noted that the one or more processors 102 and / or other data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be fully or partially integrated into any of the other components in the computing terminal (or mobile device).
[0040] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the cable phase sequence identification method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned cable phase sequence identification method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computing terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0041] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computing terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0042] Under the above operating environment, the embodiment of the present invention provides the following Figure 2 The cable phase sequence identification method shown is Figure 2 : is a flow chart of a cable phase sequence identification method according to an embodiment of the present invention, the method comprising the following implementation steps:
[0043] Step S21, obtaining the image of the ring main unit to be identified;
[0044] Step S22, using the target recognition model to perform label recognition on the ring main unit image to obtain a recognition result, wherein the target recognition model is used to recognize the label of the target cable in the ring main unit image to be recognized;
[0045] Step S23, determining the phase sequence of the target cable according to the identification result.
[0046] The ring main unit in the power industry is a group of electrical transmission and distribution equipment (high-voltage switchgear), whose functions include but are not limited to: power supply branching and power supply management, fault protection, remote control and automatic control of the power system, detection and measurement of power parameters, isolation and disconnection of different parts of the power system. The above-mentioned ring main unit image to be identified can be an image taken of the cables in the ring main unit. It should be noted that in the ring main unit, color labels are usually used to distinguish cables with different phase sequences. For newly installed ring main units, the label color of the cables in the image of the ring main unit to be identified can be identified to determine whether the cable wiring is correct.
[0047] The target recognition model can be a trained recognition model based on the YOLOX-S target detection neural network. The recognition result includes at least the label color of the target cable in the image of the ring main unit to be recognized, and the label color can be used to determine the wiring sequence of the target cable (ie, the phase sequence).
[0048] The present invention can compare the label color of the cable with the label color on the connecting device (or the terminal block). When the comparison determines that the label colors correspond, it is determined that the cable wiring is correct, or when the comparison determines that the label colors are inconsistent, it is determined that the cable wiring is incorrect.
[0049] In an embodiment of the present invention, the image of the ring network cabinet to be identified is first obtained, and then the target recognition model is used to perform label recognition on the image of the ring network cabinet to be identified to obtain a recognition result, wherein the target recognition model is used to identify the label of the target cable in the image of the ring network cabinet to be identified, and finally the phase sequence of the target cable is determined according to the recognition result. The target recognition model is obtained by constructing and training, and then the target recognition model is used to accurately detect small targets in the image of the ring network cabinet to be identified to accurately identify the label of the target cable in the image of the ring network cabinet to be identified, thereby determining the phase sequence of the target cable according to the label sequence, and achieving the purpose of accurately identifying the phase sequence of the cable in the image of the ring network cabinet, thereby achieving the technical effect of improving the accuracy and efficiency of cable phase sequence recognition and improving the robustness of the cable phase sequence recognition method, thereby solving the technical problem that the prior art provides a ring network cabinet cable phase sequence recognition method that relies on manual detection and recognition, resulting in low recognition efficiency and poor robustness.
[0050] The above method of the embodiment of the present invention is further introduced below.
[0051] In an optional embodiment, the cable phase sequence identification method further includes:
[0052] Step S240, collecting an original image data set of the ring main unit based on the target shooting device;
[0053] Step S241, performing multi-angle rotation on the original image data set to obtain a first image data set;
[0054] Step S242, performing multi-size cropping on the images in the first image data set to obtain a second image data set;
[0055] Step S243, performing multi-parameter adjustment on the images in the second image data set to obtain a sample image data set;
[0056] Step S244, performing data enhancement processing on the sample image data set using the target data enhancement method to obtain an image training set;
[0057] Step S245, using the backbone network to perform feature extraction on the image training set to obtain a first feature atlas;
[0058] Step S246, using the intermediate network to perform feature fusion on the first feature atlas to obtain a second feature atlas;
[0059] Step S247, using the detection head of the prediction layer to perform classification prediction on the second feature atlas to obtain a prediction result, wherein the prediction result is used to determine the prediction label of any cable in any image of the second feature atlas;
[0060] Step S248, evaluating the model performance according to the predicted label to obtain an evaluation result, wherein the evaluation result is used to determine the label recognition accuracy;
[0061] Step S249, in response to the label recognition accuracy rate obtained from the multiple iterations of training converging, the recognition model obtained from the last iteration of the multiple iterations of training is determined as the target recognition model.
[0062] The above-mentioned target shooting device can be a camera, a drone, or other device that can be used to collect images and videos. As an optional implementation, a 12-megapixel, 4x zoom camera is used as the imaging device to shoot the internal video of the ring main unit at different angles and lighting conditions, and then the collected internal video screenshots of the ring main unit are screened to obtain an original image data set containing 352 images of the ring main unit.
[0063] The above-mentioned image enhancement processing may include but is not limited to rotation, cropping, and parameter (for example, image color) adjustment. After image enhancement processing, it can be used to obtain ring network cabinet images containing various angles and environmental complexities, so as to improve the richness of the original image data set, thereby improving the accuracy and robustness of the trained target recognition model.
[0064] Still in the above optional implementation, in order to prevent the target recognition model from overfitting due to insufficient diversity of collected images, ring network cabinet images in backlight, front light or complex background environments are selected respectively. Furthermore, in order to improve the generalization of the original image data set, the selected ring network cabinet images are first rotated at multiple angles (for example: 90°, 180°, 270°) to simulate the diversity of drone shooting angles in reality. Then, the rotated ring network cabinet images are cropped at multiple sizes and the image size is adjusted to simulate the diversity of distances during shooting. Then, the brightness, saturation and other parameters of the cropped ring network cabinet images are adjusted to simulate the differences in pictures taken in different weather conditions. Finally, the original image data set containing 555 ring network cabinet images is expanded.
[0065] The present invention enables the recognition model to better obtain effective feature information in the ring main unit image through image enhancement processing, thereby improving the adaptability of the recognition model to different shooting scenes and different background environments.
[0066] In step S244, the sample image data set is subjected to data enhancement processing using the target data enhancement method, and the image training set obtained includes:
[0067] Step S2441, selecting any number of images from the sample image data set;
[0068] Step S2442, performing geometric transformation and color space transformation on any plurality of images to obtain a plurality of first transformed images;
[0069] Step S2443, stitching the plurality of first transformed images according to a preset stitching rule to obtain a stitched image;
[0070] Step S2444, constructing an image training set based on the multiple stitched images.
[0071] The target data enhancement method may be an improved Mosaic data enhancement method. The traditional Mosaic data enhancement method is to randomly crop four pictures and then splice them to obtain a picture for training the model. The present invention improves the traditional Mosaic data enhancement method (such as Figure 3 Specifically, 6 ring main cabinet images in the original image data set are randomly read, and the 6 ring main cabinet images are respectively subjected to processing operations such as flipping, scaling, and color gamut change, and the 6 processed ring main cabinet images are randomly cropped and spliced into a ring main cabinet image for training the recognition model (i.e., the above-mentioned spliced image). It can be understood that the improved Mosaic data enhancement method can not only increase the number of sample images in the image training set, but also enrich the background environment and small targets in the sample images, thereby improving the model training effect.
[0072] In an optional embodiment, in step S245, the backbone network includes a first network, a second network and a pooling layer, and the backbone network is used to extract features from the image training set to obtain a first feature atlas including:
[0073] Step S2451, using the first network to slice any image in the image training set to obtain multiple second transformed images;
[0074] Step S2452, using the second network to perform step-wise convolution and splicing on the plurality of second transformed images to obtain a third feature atlas;
[0075] Step S2453, using a pooling layer to perform cross-size feature detection and extraction on the third feature atlas to obtain a first feature atlas.
[0076] The following combination Figure 4 The above method is further explained.
[0077] Figure 4 is a schematic diagram of an optional target recognition model according to an embodiment of the present invention, such as Figure 4As shown, the pre-built initial recognition model at least includes an input end (the above-mentioned image enhancement processing part), a backbone network, an intermediate network (neck) and a prediction layer (prediction), wherein the backbone network backbone includes a first network Focus, a second network CSPDarknet, and a pooling layer SPP (Spatial Pyramid Pooling, spatial pyramid pooling layer), and CSPDarknet is composed of a cross-stage partial network and a dark network Darknet. Figure 4 The CBS shown in is a convolution processing module. CBS consists of a convolution layer conv, a batch normalization layer (Batch normalization) and an activation function Silu.
[0078] Still Figure 4 As shown, in the present invention, the input end of the initial recognition model is first used to perform image enhancement processing on the ring main unit image of the original image data set to obtain the input image of the backbone network backbone. The input image is first sliced by the first network. Specifically: for the input image with a pixel size of 640×604, the first network takes a value for each pixel, concentrates its width (width, W) and height (height, H) information into the channel space, and expands the number of channels by 4 times, thereby expanding the number of channels from 3 to 12. After the Focus processing of the first network, a feature map with a pixel size of 320×320×12 is obtained.
[0079] Furthermore, if Figure 5 As shown in the figure, the backbone network backbone performs four downsampling on the feature map (P1) obtained after Focus processing. Each time the feature map is downsampled to half of the feature map before downsampling. After four downsamplings, four effective feature layers (P2out to P5out) with output pixels of 20×20, 40×40, 80×80, and 160×160 are obtained. It should be noted that the SPP structure is added to the backbone network, and the maximum pooling of different pooling kernels can be used for feature extraction to improve the network's receptive field, thereby improving the generalization ability of the model.
[0080] It should be noted that Figure 5 The fusion operation of the feature layer can be shown as follows:
[0081] P2out=[P2+P3+(P4+p5↑ 2× )↑ 2× ]↑ 2× Formula (1)
[0082] P3out=P2out↓2× +P3+(P4+p5↑ 2× )↑ 2× Formula (2)
[0083] P4out=P3↓ 2× +P4+p5↑ 2× Formula (3)
[0084] P5out=P4↓ 2× +p5 Formula (4)
[0085] In the above formulas (1) to (4), ↑ 2× Indicates that the feature map is upsampled by 2 times, ↓ 2× Indicates that the feature map is downsampled by 2 times, and + indicates the superposition of channels.
[0086] The above optional embodiment uses the Focus layer to slice the original image data set of the ring main unit, thereby retaining the original image information as much as possible, so that the recognition model can capture more original image information during training, thereby improving the model training effect.
[0087] In an optional embodiment, in step S246, the intermediate network includes a third network and a fourth network, and the intermediate network is used to perform feature fusion on the first feature atlas to obtain a second feature atlas including:
[0088] Step S2461, performing multiple upsampling on any image in the first feature atlas based on the third network to obtain a fifth feature atlas;
[0089] Step S2462: Perform bottom-up feature fusion on the fifth feature atlas based on the fourth network to obtain a second feature atlas.
[0090] The third network may be a Feature Pyramid Network (FPN), which may use pyramid features of an image to detect objects of different sizes. The fourth network may be a Path Aggregation Network (PAN), which may solve the problem of information loss in top-down feature propagation in an FPN network.
[0091] like Figure 4 , Figure 6As shown, the third network performs 2x upsampling (UpSampling2D) feature fusion on the feature maps of the four feature layers obtained by the backbone network Focus processing to obtain new feature maps composed of different feature layers (multiple new feature maps constitute the fifth feature atlas), and then the bottom-up PAN network performs bottom-up feature fusion to obtain the second feature atlas for prediction.
[0092] It should be noted that Figure 6 Resblock_body refers to the residual unit, and DownSampling2D refers to 2x downsampling.
[0093] The above-mentioned embodiment of the present invention improves the feature fusion capability of the network by combining the FPN network with the PAN network, thereby helping to improve the recognition effect of the model.
[0094] In an optional embodiment, in step S247, the detection head includes a first detection branch, a second detection branch, and a third detection branch, and the detection head of the prediction layer is used to perform classification prediction on the second feature atlas, and the prediction results obtained include:
[0095] Step S2471, using the first detection branch to predict the position of any cable to obtain a target frame, wherein the target frame is used to locate the cable;
[0096] Step S2472, using the second detection branch to predict the label category of any cable to obtain a category score;
[0097] Step S2475, using the third detection branch to perform confidence prediction on any cable to obtain a confidence score;
[0098] Step S2476, determine the predicted label of any cable based on the target box, category score and confidence score to obtain a predicted result.
[0099] Still Figure 4 As shown, the detection head Head of the prediction layer in the recognition model includes: a first detection branch reg, which is used to predict the target box of the feature map; a second detection branch cls, which is used to predict the category score of the target box; and a third detection branch obj, which is used to determine the confidence prediction of the target box to determine whether the target box is a foreground or background.
[0100] After determining the category scores of each target box, score screening and non-maximum suppression are performed to generate a prediction box to determine the predicted label of any cable in the ring network cabinet image based on the prediction box.
[0101] In an optional embodiment, in step S248, the model performance is evaluated according to the predicted label, and the evaluation result includes:
[0102] Step S2481, judging the correctness of the predicted label according to the real label of any image in the second feature atlas, and obtaining a judgment result, wherein the judgment result includes the number of correct predicted labels and the number of incorrectly predicted labels corresponding to the second feature atlas;
[0103] Step S2482, using the number of correctly predicted labels and the number of incorrectly predicted labels to calculate the label recognition accuracy, and obtain an evaluation result.
[0104] In the present invention, whether the model training is completed can be evaluated by the model recognition accuracy during the model training process. Specifically: the recognition accuracy of the recognition model for the cable prediction label in the original image data set is calculated. When the recognition accuracy reaches a preset value, it indicates that the recognition accuracy of the currently trained recognition model meets the requirements, so that the currently trained recognition model can be used as the target recognition model.
[0105] Figure 7 is a schematic diagram of an optional cable phase sequence identification result according to an embodiment of the present invention, such as Figure 7 As shown, after the target recognition model detects and recognizes the ring main unit image to be identified, the position and color of the cable labels in images 8-1 to 8-3 are marked. Specifically: the label color of the cable in the middle position in image 8-1 is blue. Since the labels of the left and right cables are completely blocked, the target recognition model cannot recognize the color labels of the left and right cables; the colors of the cable labels in image 8-2 are yellow, blue, and red from left to right, and the color labels of the three cables are located at the bottom; the colors of the cable labels in image 8-3 are yellow, blue, and red from left to right, and the color labels of the three cables are located at the top.
[0106] By experimentally verifying the cable identification method of the present invention with other existing identification algorithms (for example, a multi-category single-order detector algorithm, a fast regional convolutional neural network algorithm FastR-CNN, and a real-time target detection algorithm YOLOv1), and comparing the recognition accuracy of the cable identification method of the present invention or other existing identification algorithms under different intersection-over-union thresholds (IoU thresholds), it can be determined that the cable identification method provided by the present invention has a recognition accuracy higher than 98%.
[0107] The cable phase sequence identification method provided in the above embodiment of the present invention is improved based on the existing YOLOX target detection neural network. On the basis of the three effective feature layers generated by the original backbone network CSPDarknet, a layer of identification feature layer for extremely small targets is added, and feature fusion of four scales is performed in the improved feature extraction network part, which improves the detection and identification effect of extremely small targets, thereby improving the recognition efficiency of the cable identification method and enhancing the robustness of the cable identification method to complex background environments in images.
[0108] In this embodiment, a cable phase sequence identification device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, a "module" is a combination of software and / or hardware that can implement a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0109] Figure 8 is a structural block diagram of a cable phase sequence identification device according to an embodiment of the present invention. Figure 8 As shown, the device comprises:
[0110] An acquisition module 801 is used to acquire an image of a ring main unit to be identified;
[0111] The recognition module 802 is used to perform label recognition on the ring main unit image to be recognized by using the target recognition model to obtain a recognition result, wherein the target recognition model is used to recognize the label of the target cable in the ring main unit image to be recognized;
[0112] The determination module 803 is used to determine the phase sequence of the target cable according to the identification result.
[0113] Optionally, the above-mentioned cable phase sequence identification device also includes: a training module 804, which is used to collect the original image data set of the ring network cabinet based on the target shooting device; rotate the original image data set at multiple angles to obtain a first image data set; crop the images in the first image data set to multiple sizes to obtain a second image data set; adjust the images in the second image data set to multiple parameters to obtain a sample image data set; use the target data enhancement method to perform data enhancement processing on the sample image data set to obtain an image training set; use the backbone network to extract features from the image training set to obtain a first feature atlas; use the intermediate network to perform feature fusion on the first feature atlas to obtain a second feature atlas; use the detection head of the prediction layer to classify and predict the second feature atlas to obtain a prediction result, wherein the prediction result is used to determine the predicted label of any cable in any image of the second feature atlas; evaluate the model performance according to the predicted label to obtain an evaluation result, wherein the evaluation result is used to determine the label recognition accuracy; in response to the convergence of the label recognition accuracy obtained by multiple iterative training, the recognition model obtained by the last iterative training in the multiple iterative training is determined as the target recognition model.
[0114] Optionally, the above-mentioned training module 804 is also used to: use the target data enhancement method to perform data enhancement processing on the sample image data set to obtain an image training set including: selecting any number of images from the sample image data set; performing geometric transformation and color space transformation on any number of images to obtain multiple first transformed images; splicing the multiple first transformed images according to preset splicing rules to obtain a spliced image; and forming an image training set based on the multiple spliced images.
[0115] Optionally, the above-mentioned training module 804 is also used for: the backbone network includes a first network, a second network and a pooling layer, and the backbone network is used to extract features from the image training set to obtain a first feature atlas, including: using the first network to slice any image in the image training set to obtain multiple second transformed images; using the second network to perform step-by-step convolution and splicing on the multiple second transformed images to obtain a third feature atlas; using the pooling layer to perform cross-size feature detection and extraction on the third feature atlas to obtain the first feature atlas.
[0116] Optionally, the above-mentioned training module 804 is also used for: the intermediate network includes a third network and a fourth network, and the intermediate network is used to perform feature fusion on the first feature atlas to obtain the second feature atlas, including: multiple upsampling of any image in the first feature atlas based on the third network to obtain a fifth feature atlas; and bottom-up feature fusion of the fifth feature atlas based on the fourth network to obtain the second feature atlas.
[0117] Optionally, the above-mentioned training module 804 is also used for: the detection head includes a first detection branch, a second detection branch and a third detection branch, and the detection head of the prediction layer is used to perform classification prediction on the second feature atlas, and the prediction results include: using the first detection branch to predict the position of any cable to obtain a target box, wherein the target box is used to locate the cable; using the second detection branch to predict the label category of any cable to obtain a category score; using the third detection branch to predict the confidence of any cable to obtain a confidence score; determining the predicted label of any cable based on the target box, category score and confidence score to obtain a prediction result.
[0118] Optionally, the above-mentioned training module 804 is also used to: evaluate the model performance according to the predicted labels, and obtain the evaluation results including: judging the correctness of the predicted labels according to the true labels of any image in the second feature atlas, and obtaining the judgment results, wherein the judgment results include the number of correct predicted labels and the number of incorrectly predicted labels corresponding to the second feature atlas; using the number of correctly predicted labels and the number of incorrectly predicted labels to calculate the label recognition accuracy, and obtain the evaluation results.
[0119] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0120] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above-mentioned cable phase sequence identification methods is implemented.
[0121] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, any one of the aforementioned cable phase sequence identification methods is implemented.
[0122] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0123] Step S1, obtaining an image of a ring main unit to be identified;
[0124] Step S2, using the target recognition model to perform label recognition on the ring main unit image to be recognized, and obtain a recognition result, wherein the target recognition model is used to recognize the label of the target cable in the ring main unit image to be recognized;
[0125] Step S3, determining the phase sequence of the target cable according to the identification result.
[0126] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0127] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any one of the aforementioned cable phase sequence identification methods.
[0128] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0129] Step S1, obtaining an image of a ring main unit to be identified;
[0130] Step S2, using the target recognition model to perform label recognition on the ring main unit image to be recognized, and obtain a recognition result, wherein the target recognition model is used to recognize the label of the target cable in the ring main unit image to be recognized;
[0131] Step S3, determining the phase sequence of the target cable according to the identification result.
[0132] Optionally, the above-mentioned processor can also be used to: collect the original image data set of the ring main unit based on the target shooting device; perform image enhancement processing on the original image data set to obtain a sample image data set; and facilitate the sample image data set to iteratively train a pre-built initial recognition model to obtain a target recognition model.
[0133] Optionally, the above-mentioned processor can also be used to: perform image enhancement processing on the original image data set to obtain a sample image data set, including: performing multi-angle rotation on the original image data set to obtain a first image data set; performing multi-size cropping on the images in the first image data set to obtain a second image data set; performing multi-parameter adjustment on the images in the second image data set to obtain a sample image data set.
[0134] Optionally, the processor can also be used to: facilitate iterative training of a pre-built initial recognition model using a sample image data set to obtain a target recognition model, including: using a target data enhancement method to perform data enhancement processing on the sample image data set to obtain an image training set; using a backbone network to extract features from the image training set to obtain a first feature atlas; using an intermediate network to perform feature fusion on the first feature atlas to obtain a second feature atlas; using a detection head of a prediction layer to perform classification prediction on the second feature atlas to obtain a prediction result, wherein the prediction result is used to determine the predicted label of any cable in any image of the second feature atlas; evaluating the model performance based on the predicted label to obtain an evaluation result, wherein the evaluation result is used to determine the label recognition accuracy; in response to the convergence of the label recognition accuracy obtained from multiple iterative trainings, determining the recognition model obtained from the last iterative training in the multiple iterative trainings as the target recognition model.
[0135] Optionally, the above-mentioned processor can also be used to: use the target data enhancement method to perform data enhancement processing on the sample image data set to obtain an image training set including: selecting any number of images from the sample image data set; performing geometric transformation and color space transformation on any number of images to obtain multiple first transformed images; splicing the multiple first transformed images according to preset splicing rules to obtain a spliced image; and constructing an image training set based on the multiple spliced images.
[0136] Optionally, the above-mentioned processor can also be used for: the backbone network includes a first network, a second network and a pooling layer, and the backbone network is used to extract features from the image training set to obtain a first feature atlas, including: using the first network to slice any image in the image training set to obtain multiple second transformed images; using the second network to perform step-by-step convolution and splicing on the multiple second transformed images to obtain a third feature atlas; using the pooling layer to perform cross-size feature detection and extraction on the third feature atlas to obtain the first feature atlas.
[0137] Optionally, the above-mentioned processor can also be used for: the intermediate network includes a third network and a fourth network, and the intermediate network is used to perform feature fusion on the first feature atlas to obtain the second feature atlas, including: multiple upsampling of any image in the first feature atlas based on the third network to obtain a fifth feature atlas; and bottom-up feature fusion of the fifth feature atlas based on the fourth network to obtain the second feature atlas.
[0138] Optionally, the above-mentioned processor can also be used for: the detection head includes a first detection branch, a second detection branch and a third detection branch, and the detection head of the prediction layer is used to perform classification prediction on the second feature atlas, and the prediction results include: using the first detection branch to predict the position of any cable to obtain a target box, wherein the target box is used to locate the cable; using the second detection branch to predict the label category of any cable to obtain a category score; using the third detection branch to predict the confidence of any cable to obtain a confidence score; determining the predicted label of any cable based on the target box, category score and confidence score to obtain a prediction result.
[0139] Optionally, the above-mentioned processor can also be used to: evaluate the model performance according to the predicted labels, and obtain the evaluation results including: judging the correctness of the predicted labels according to the true labels of any image in the second feature atlas, and obtaining the judgment results, wherein the judgment results include the number of correct predicted labels and the number of incorrectly predicted labels corresponding to the second feature atlas; and using the number of correctly predicted labels and the number of incorrectly predicted labels to calculate the label recognition accuracy and obtain the evaluation results.
[0140] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiment and its optional implementation modes, and this embodiment will not be described in detail here.
[0141] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0142] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0143] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0145] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0146] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, magnetic disk or optical disk, etc., various media that can store program codes.
[0147] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A cable phase sequence identification method, characterized in that: include: Acquire the image of the ring main unit to be identified; Using a target recognition model to perform label recognition on the ring main unit image to be recognized, and obtain a recognition result, wherein the target recognition model is used to recognize the label of the target cable in the ring main unit image to be recognized; The phase sequence of the target cable is determined according to the identification result.
2. The cable phase sequence identification method according to claim 1, characterized in that: The cable phase sequence identification method further comprises: Collect the original image data set of the ring main unit based on the target shooting device; Performing multi-angle rotation on the original image data set to obtain a first image data set; Performing multi-size cropping on the images in the first image data set to obtain a second image data set; Performing multi-parameter adjustment on the images in the second image data set to obtain the sample image data set; Performing data enhancement processing on the sample image data set using a target data enhancement method to obtain an image training set; Using a backbone network to extract features from the image training set to obtain a first feature atlas; Using an intermediate network to perform feature fusion on the first feature atlas to obtain a second feature atlas; Using the detection head of the prediction layer to perform classification prediction on the second feature atlas to obtain a prediction result, wherein the prediction result is used to determine the predicted label of any cable in any image of the second feature atlas; Evaluate the model performance according to the predicted label to obtain an evaluation result, wherein the evaluation result is used to determine the label recognition accuracy; In response to the label recognition accuracy rate obtained from multiple iterations of training converging, a recognition model obtained from the last iteration of the multiple iterations of training is determined as the target recognition model.
3. The cable phase sequence identification method according to claim 2, characterized in that: The target data enhancement method is used to perform data enhancement processing on the sample image data set to obtain the image training set including: Select any number of images from the sample image dataset; Performing geometric transformation and color space transformation on the arbitrary multiple images to obtain multiple first transformed images; splicing the plurality of first transformed images according to a preset splicing rule to obtain a spliced image; The image training set is formed based on a plurality of the spliced images.
4. The cable phase sequence identification method according to claim 2, characterized in that: The backbone network includes a first network, a second network and a pooling layer. The backbone network is used to extract features from the image training set, and the first feature atlas obtained includes: Using the first network to slice any image in the image training set to obtain a plurality of second transformed images; Using the second network to perform step-wise convolution and splicing on the plurality of second transformed images to obtain a third feature atlas; The pooling layer is used to perform cross-scale feature detection and extraction on the third feature atlas to obtain the first feature atlas.
5. The cable phase sequence identification method according to claim 2, characterized in that: The intermediate network includes a third network and a fourth network, and the intermediate network is used to perform feature fusion on the first feature atlas to obtain the second feature atlas, including: Based on the third network, upsampling any image in the first feature atlas multiple times to obtain a fifth feature atlas; Based on the fourth network, bottom-up feature fusion is performed on the fifth feature atlas to obtain the second feature atlas.
6. The cable phase sequence identification method according to claim 2, characterized in that: The detection head includes a first detection branch, a second detection branch and a third detection branch. The detection head of the prediction layer is used to perform classification prediction on the second feature atlas, and the prediction result obtained includes: Using the first detection branch to predict the position of any one of the cables to obtain a target frame, wherein the target frame is used to locate the cable; Using the second detection branch to predict the label category of any one of the cables to obtain a category score; Using the third detection branch to perform confidence prediction on any one of the cables to obtain a confidence score; The predicted label of the arbitrary cable is determined based on the target box, the category score and the confidence score to obtain the predicted result.
7. The cable phase sequence identification method according to claim 2, characterized in that: The model performance is evaluated according to the predicted labels, and the evaluation results obtained include: According to the real label of any image in the second feature atlas, the correctness of the predicted label is judged to obtain a judgment result, wherein the judgment result includes the number of correct predicted labels and the number of incorrect predicted labels corresponding to the second feature atlas; The label recognition accuracy is calculated using the number of correctly predicted labels and the number of incorrectly predicted labels to obtain the evaluation result.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the cable phase sequence identification method according to any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cable phase sequence identification method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the cable phase sequence identification method according to any one of claims 1 to 7.
