A Deep Learning-Based Method and System for Identifying Wiring Sequence in Power Distribution Examination Cabinets
By using a lightweight wiring sequence recognition network model based on deep learning, the accuracy problem of wiring sequence recognition under various lighting and base plate color conditions of traditional methods is solved, realizing efficient and accurate automatic recognition of wiring sequence and improving the intelligence level of the examination.
Patent Information
- Application Number
- CN202211527671.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-11-30
AI Technical Summary
In practical exams on safe electricity use management in distribution cabinets, existing technologies rely on invigilators visually inspecting the wiring sequence, leading to misjudgments and visual fatigue. Furthermore, traditional algorithms struggle to accurately identify the wiring sequence under conditions of uneven lighting and diverse base plate colors.
A lightweight wiring sequence recognition network model based on deep learning is adopted. By preprocessing images and using the argmax function to process the color array, combined with color label mapping and negative sample removal, the wiring sequence is identified.
Under conditions of uneven lighting and diverse base plate colors, efficient and accurate wiring sequence identification was achieved, reducing the burden on invigilators and improving the intelligence level of the examination process.
Smart Images

Figure CN115965952B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power distribution examination cabinet technology, specifically to a method and system for identifying the wiring sequence of power distribution examination cabinets based on deep learning. Background Technology
[0002] Distribution cabinets (boxes) include power distribution cabinets (boxes), lighting distribution cabinets (boxes), and metering cabinets (boxes), and are the final-level equipment in a power distribution system. The secondary wiring diagram of a distribution cabinet shows the electrical connections between secondary electrical equipment. Secondary wiring refers to the secondary wiring of voltage transformers, current transformers, voltmeters, ammeters, electricity meters, switch control lines, and signal light lines in the distribution cabinet. In other words, almost all the wires inside a distribution cabinet, except for the primary power supply lines, are secondary wiring. The secondary wiring within a distribution cabinet is crucial; therefore, the basic requirements for secondary circuit wiring in distribution cabinets (boxes) are: construction according to the diagram and correct wiring.
[0003] To train and test the wiring skills of staff, a test on the safe use of electricity in distribution cabinets is set up. In the test on the safe use of electricity in distribution cabinets, the wiring sequence in the practical part is particularly important. The correct wiring sequence is related to the life safety of each candidate and also lays a solid foundation for them to become a qualified electrician in the future.
[0004] Currently, the practical examination on safe electricity use control of distribution cabinets mainly relies on invigilators. Whether the wiring sequence is correct or not requires the invigilator to check with their own eyes, which is time-consuming and laborious. At the same time, one invigilator needs to be responsible for multiple candidates at the same time, and long-term invigilation can easily lead to visual fatigue and misjudgment.
[0005] In the literature "Design of Electrical Experiment Teaching Wiring Rating System Based on Machine Vision", the wires are segmented based on the traditional algorithm of wire sequence recognition, and the color of each wire is determined by HSV color threshold. However, due to factors such as uneven lighting and diverse background colors, the extraction of wires is quite difficult. In practical applications, the algorithm cannot be used due to reasons such as wire omission or incorrect extraction.
[0006] Therefore, it is essential to propose an identification method that can correctly identify the wiring sequence regardless of whether the light is dim or the color of the base plate.
[0007] In order to solve the above problems, people have been seeking an ideal technological solution. Summary of the Invention
[0008] The purpose of this invention is to address the shortcomings of existing technologies by providing a method and system for identifying wiring sequence in power distribution test cabinets based on deep learning, which can correctly identify the wiring sequence regardless of lighting conditions or the color of the base plate.
[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0010] The first aspect of this invention provides a method for identifying the wiring sequence of a power distribution examination cabinet based on deep learning, the method comprising the following steps:
[0011] Pre-build a lightweight wiring sequence recognition network model;
[0012] After the student completes the wiring operation, the first image to be tested corresponding to the wiring sequence identification area is collected; wherein, the wiring sequence identification area refers to the wiring area of the power distribution test cabinet, the height of the first image to be tested is H, and the width of the first image to be tested is W.
[0013] The recognition area of the first image to be tested is scaled to obtain the second image to be tested; wherein the height of the second image to be tested is h', the width of the second image to be tested is w', and w' = (h' × W) ÷ H;
[0014] N 50×50 rectangular images are extracted from the second image to be tested, following a left-to-right order and a step size step; wherein the step size step = h' ÷ 2;
[0015] Input N 50×50 rectangular images into the lightweight wiring sequence recognition network model to obtain N one-dimensional color arrays;
[0016] The argmax function is used to process the N one-dimensional color arrays output by the lightweight wiring sequence recognition network model to predict the category indices corresponding to the N rectangular images; the N rectangular images are then set to correspond one-to-one with the N predicted category indices.
[0017] The predicted N category indices are mapped to their corresponding color labels to obtain N color labels; different category indices and different color labels are pre-configured as a one-to-one mapping relationship;
[0018] Remove adjacent and identical color tags from N color tags to obtain M target color tags; where M≤N;
[0019] Remove the negative samples NG from the M target color labels to obtain the wire color order corresponding to the wiring sequence identification area.
[0020] A second aspect of this invention provides a deep learning-based wiring sequence recognition system for power distribution testing cabinets. The system includes a network model management module, a test image acquisition module, a recognition area scaling module, a rectangular image cropping module, a color array prediction module, a category index prediction module, a color label prediction module, and a wire color order determination unit.
[0021] The identification network model management module is used to pre-build a lightweight wiring sequence identification network model;
[0022] The image acquisition module is used to acquire the first image to be tested corresponding to the wiring sequence identification area after the student completes the wiring operation; wherein, the wiring sequence identification area refers to the wiring area of the power distribution test cabinet, the height of the first image to be tested is H, and the width of the first image to be tested is W.
[0023] The recognition region scaling module is used to scale the recognition region of the first image to be tested to obtain a second image to be tested; wherein, the height of the second image to be tested is h', the width of the second image to be tested is w', and w' = (h' × W) ÷ H;
[0024] The rectangular image cropping module is used to crop N 50×50 rectangular images from the second image to be tested according to a left-to-right order and a step size step; wherein, the step size step = h' ÷ 2;
[0025] The color array prediction module is used to input N 50×50 rectangular images into the lightweight wiring sequence recognition network model to obtain N one-dimensional color arrays.
[0026] The category index prediction module is used to process the N one-dimensional color arrays output by the lightweight wiring sequence recognition network model using the argmax function to predict the category indexes corresponding to the N rectangular images; the N rectangular images are set to correspond one-to-one with the predicted N category indices;
[0027] The color label prediction module is used to map the predicted N category indices to their corresponding color labels to obtain N color labels; different category indices and different color labels are pre-configured as a one-to-one mapping relationship;
[0028] The wire color order determination unit is used to remove adjacent and identical color labels from N color labels to obtain M target color labels; it is also used to remove negative samples NG from the M target color labels to obtain the wire color order corresponding to the wiring order identification area; where M≤N.
[0029] A third aspect of the present invention provides a readable storage medium having instructions stored thereon, which, when executed by a processor, implement the steps of the deep learning-based wiring sequence identification method for power distribution examination cabinets as described above.
[0030] This invention has outstanding substantive features and significant progress compared to the prior art, specifically:
[0031] 1) This invention pre-constructs a lightweight wiring sequence recognition network model, combines recognition area scaling operations and rectangular image cropping operations to preprocess the image to be tested, and inputs the preprocessed image into the lightweight wiring sequence recognition network model to obtain N one-dimensional color arrays; the argmax function is used to process the obtained color arrays to predict the category indices corresponding to the N rectangular images, and the color label corresponding to the category index is determined according to the mapping relationship between the category index and the color label, thereby obtaining the wire color order corresponding to the wiring sequence recognition area;
[0032] Therefore, the present invention can still identify the correct line sequence under conditions such as uneven lighting and diverse base plate colors, and the line sequence identification efficiency is fast and the line sequence identification accuracy is high.
[0033] 2) This invention can effectively improve the intelligence level of the examination process, reduce the burden on invigilators, and provide a benchmark for intelligent examination of power distribution cabinet operation;
[0034] 3) This invention has significantly improved the accuracy of wiring sequence identification in the industry, and it is highly real-time, making it of great commercial application value. Attached Figure Description
[0035] Figure 1 This is a flowchart illustrating the deep learning-based wiring sequence identification method for power distribution examination cabinets according to the present invention. Figure 1 ;
[0036] Figure 2 This is a schematic diagram of the lightweight wiring sequence identification network model of the present invention. Figure 1 ;
[0037] Figure 3 This is a schematic diagram of the lightweight wiring sequence identification network model of the present invention. Figure 2 ;
[0038] Figure 4 This is a schematic diagram of the lightweight wiring sequence identification network model of the present invention. Figure 2 ;
[0039] Figure 5 This is a schematic diagram of the wiring sequence identification method for power distribution examination cabinet based on deep learning according to the present invention. Figure 1 ;
[0040] Figure 6 This is a schematic diagram of the wiring sequence identification system for power distribution examination cabinet based on deep learning, as described in this invention. Figure 2 ;
[0041] Figures 7(a) and 7(b) are images of the same wiring sequence identification area collected under different lighting conditions in a specific embodiment of the present invention;
[0042] Figures 8(a), 8(b), and 8(c) are visual representations of the line sequence recognition process corresponding to Figure 7(a).
[0043] Figure 9 This is a schematic diagram of the inference speed test results of the network model corresponding to Figure 7(a);
[0044] Figure 10 These are on-site photos from a second specific embodiment of the present invention;
[0045] Figure 11 yes Figure 10 Corresponding recognition effect diagram;
[0046] Figure 12 This is a schematic diagram of the test set accuracy in the third specific embodiment of the present invention;
[0047] Figure 13 This is a schematic diagram of the loss curve in the third specific embodiment of the present invention. Detailed Implementation
[0048] The technical solution of the present invention will be further described in detail below through specific embodiments.
[0049] BN (BatchNorm) refers to a normalization layer, which is a type of neural network layer.
[0050] AdaptiveAVqpool refers to an adaptive pooling layer.
[0051] Example 1
[0052] As attached Figure 1 As shown, a deep learning-based method for identifying the wiring sequence of a power distribution examination cabinet includes the following steps:
[0053] Pre-build a lightweight wiring sequence recognition network model;
[0054] After the student completes the wiring operation, the first image to be tested corresponding to the wiring sequence identification area is collected; wherein, the wiring sequence identification area refers to the wiring area of the power distribution test cabinet, one first image to be tested corresponds to one wiring sequence identification area, the height of the first image to be tested is H, and the width of the first image to be tested is W.
[0055] The recognition area of the first image to be tested is scaled to obtain the second image to be tested; wherein the height of the second image to be tested is h', the width of the second image to be tested is w', and w' = (h' × W) ÷ H;
[0056] N 50×50 rectangular images are extracted from the second image to be tested, following a left-to-right order and a step size step; wherein the step size step = h' ÷ 2;
[0057] Input N 50×50 rectangular images into the lightweight wiring sequence recognition network model to obtain N one-dimensional color arrays;
[0058] The argmax function is used to process the N one-dimensional color arrays output by the lightweight wiring sequence recognition network model to predict the category indices corresponding to the N rectangular images; the N rectangular images are then set to correspond one-to-one with the N predicted category indices.
[0059] The predicted N category indices are mapped to their corresponding color labels to obtain N color labels; different category indices and different color labels are pre-configured as a one-to-one mapping relationship;
[0060] Remove adjacent and identical color tags from N color tags to obtain M target color tags; where M≤N;
[0061] Remove the negative samples NG from the M target color labels to obtain the wire color order corresponding to the wiring sequence identification area.
[0062] Wherein, the height h' of the second image to be tested is 50, in pixels; the argmax function is the function that finds the maximum value of the independent variable, used to obtain the maximum value in each 1-dimensional color array as the category index.
[0063] It is understandable that when identifying wiring sequence, the region of interest is first defined. Since the camera is fixed, a fixed wiring sequence identification area can be set.
[0064] As attached Figure 2 To be continued Figure 4 As shown, the lightweight wiring sequence identification network model includes a first network structure, a second network structure, a third network structure, a fourth network structure, a fifth network structure, and a sixth network structure arranged sequentially, wherein...
[0065] The first network structure includes a convolutional layer I, a batch normalization (BN) layer I, a ReLU activation function layer I, and a MaxPool pooling layer I arranged sequentially. The network layer output parameters of the convolutional layer I, the BN layer I, and the ReLU activation function layer I are all configured to be 64×25×25, and the network layer output parameters of the MaxPool pooling layer I are configured to be 64×13×13.
[0066] The second network structure includes a convolutional layer II, a BN layer II, a ReLU activation function layer II, a convolutional layer III, a BN layer III, a convolutional layer IV, a BN layer IV, a ReLU activation function layer III, and a BasicBlock residual layer I, all arranged sequentially with network layer output parameters configured as 32×13×13.
[0067] The third network structure includes, in sequence, a convolutional layer V, a BN layer V, a ReLU activation function layer IV, a convolutional layer VI, a BN layer VI, a convolutional layer VII, a BN layer VII, a ReLU activation function layer V, and a BasicBlock residual layer II, all with network layer output parameters configured as 64×7×7.
[0068] The fourth network structure includes, in sequence, a convolutional layer VIII, a BN layer VIII, a ReLU activation function layer VI, a convolutional layer IX, a BN layer IX, a convolutional layer X, a BN layer X, a ReLU activation function layer VII, and a BasicBlock residual layer III, all with network layer output parameters configured as 128×4×4.
[0069] The fifth network structure includes, in sequence, a convolutional layer XI, a BN layer XI, a ReLU activation function layer VIII, a convolutional layer XII, a BN layer XII, a convolutional layer XIII, a BN layer XIII, a ReLU activation function layer IX, and a BasicBlock residual layer IV, all with their output parameters configured as 256×2×2.
[0070] The sixth network structure includes an adaptive pooling layer and a linear layer arranged sequentially. The network layer output parameters of the adaptive pooling layer are all configured to be 256×1×1, and the network layer output parameters of the linear layer are all configured to be 5.
[0071] The image size input to the lightweight wiring sequence recognition network model is configured to 50×50×3. The number of convolutional kernels and network layers in each network structure are shown in the attached figure. Figure 4 As shown;
[0072] It should be noted that the appendix Figure 4 The "-1" in the output parameters of the network layer indicates that this dimension is variable (related to the number of 50×50 rectangular images segmented; the number of images determines the dimension).
[0073] Furthermore, the predicted N category indices are mapped to their corresponding color labels. When N color labels are obtained, the following steps are performed:
[0074] When the predicted category index is 0, the corresponding color label is determined to be a negative sample NG; where negative sample NG refers to an invalid sample, corresponding to the area between the wires;
[0075] When the predicted category index is 1, the corresponding color label is determined to be yellow;
[0076] When the predicted category index is 2, the corresponding color label is determined to be green;
[0077] When the predicted category index is 3, the corresponding color label is determined to be red;
[0078] When the predicted category index is 4, the corresponding color label is determined to be black.
[0079] It should be noted that, by Figure 3 and Figure 4 As can be seen, a single 50×50×3 rectangular image, after forward inference by the lightweight wiring sequence recognition network model, yields a one-dimensional array of length 5. This array of length 5 includes 5 floating-point numbers, which represent 5 probabilities. Then, the argmax function is used to obtain the category index corresponding to the maximum probability. The category index is mapped to the corresponding wire color. Therefore, the wire color label corresponding to a single 50×50×3 rectangular image can be predicted through this mapping relationship.
[0080] To remove redundant data from N color labels, the step of eliminating adjacent and identical color labels is as follows: Specifically, when eliminating adjacent and identical color labels from the N color labels to obtain M target color labels, the following is performed:
[0081] Determine if there are any adjacent and identical color labels among N color labels.
[0082] If so, extract one of the adjacent and identical color labels as the target color label, and remove all other color labels except the target color label.
[0083] Furthermore, the deep learning-based wiring sequence identification method for power distribution examination cabinets also includes the following steps:
[0084] Based on the obtained wire color sequence, determine whether the corresponding student's wiring operation is correct;
[0085] If the obtained wire color sequence matches the pre-stored wire color sequence, the corresponding student's wiring operation is determined to be correct.
[0086] If the obtained wire color sequence is inconsistent with the pre-stored wire color sequence, the corresponding student's wiring operation is determined to be incorrect.
[0087] It should be noted that, based on the comparison between the predicted wire color sequence and the pre-stored wire color sequence, it is possible to determine whether the corresponding student's wiring operation is correct. Based on this, the teacher can quickly and accurately determine the wiring sequence identification result of the power distribution test cabinet.
[0088] Example 2
[0089] Based on Example 1, this example provides a specific implementation of a deep learning-based wiring sequence identification system for power distribution examination cabinets, as shown in the attached figure. Figure 5 and attached Figure 6 As shown;
[0090] The deep learning-based wiring sequence recognition system for power distribution testing cabinets, as shown, includes a network model management module, a test image acquisition module, a recognition area scaling module, a rectangular image cropping module, a color array prediction module, a category index prediction module, a color label prediction module, and a wire color order determination unit.
[0091] The identification network model management module is used to pre-build a lightweight wiring sequence identification network model;
[0092] The image acquisition module is used to acquire the first image to be tested corresponding to the wiring sequence identification area after the student completes the wiring operation; wherein, the wiring sequence identification area refers to the wiring area of the power distribution test cabinet, the height of the first image to be tested is H, and the width of the first image to be tested is W.
[0093] The recognition region scaling module is used to scale the recognition region of the first image to be tested to obtain a second image to be tested; wherein, the height of the second image to be tested is h', the width of the second image to be tested is w', and w' = (h' × W) ÷ H;
[0094] The rectangular image cropping module is used to crop N 50×50 rectangular images from the second image to be tested according to a left-to-right order and a step size step; wherein, the step size step = h' ÷ 2;
[0095] The color array prediction module is used to input N 50×50 rectangular images into the lightweight wiring sequence recognition network model to obtain N one-dimensional color arrays.
[0096] The category index prediction module is used to process the N one-dimensional color arrays output by the lightweight wiring sequence recognition network model using the argmax function to predict the category indexes corresponding to the N rectangular images; the N rectangular images are set to correspond one-to-one with the predicted N category indices;
[0097] The color label prediction module is used to map the predicted N category indices to their corresponding color labels to obtain N color labels; different category indices and different color labels are pre-configured as a one-to-one mapping relationship;
[0098] The wire color order determination unit is used to remove adjacent and identical color labels from N color labels to obtain M target color labels; it is also used to remove negative samples NG from the M target color labels to obtain the wire color order corresponding to the wiring order identification area; where M≤N.
[0099] Furthermore, the identification network model management module pre-constructs a lightweight wiring sequence identification network model comprising a first network structure, a second network structure, a third network structure, a fourth network structure, a fifth network structure, and a sixth network structure arranged sequentially, wherein...
[0100] The first network structure includes a convolutional layer I, a batch normalization (BN) layer I, a ReLU activation function layer I, and a MaxPool pooling layer I arranged sequentially. The network layer output parameters of the convolutional layer I, the BN layer I, and the ReLU activation function layer I are all configured to be 64×25×25, and the network layer output parameters of the MaxPool pooling layer I are configured to be 64×13×13.
[0101] The second network structure includes a convolutional layer II, a BN layer II, a ReLU activation function layer II, a convolutional layer III, a BN layer III, a convolutional layer IV, a BN layer IV, a ReLU activation function layer III, and a BasicBlock residual layer I, all arranged sequentially with network layer output parameters configured as 32×13×13.
[0102] The third network structure includes, in sequence, a convolutional layer V, a BN layer V, a ReLU activation function layer IV, a convolutional layer VI, a BN layer VI, a convolutional layer VII, a BN layer VII, a ReLU activation function layer V, and a BasicBlock residual layer II, all with network layer output parameters configured as 64×7×7.
[0103] The fourth network structure includes, in sequence, a convolutional layer VIII, a BN layer VIII, a ReLU activation function layer VI, a convolutional layer IX, a BN layer IX, a convolutional layer X, a BN layer X, a ReLU activation function layer VII, and a BasicBlock residual layer III, all with network layer output parameters configured as 128×4×4.
[0104] The fifth network structure includes, in sequence, a convolutional layer XI, a BN layer XI, a ReLU activation function layer VIII, a convolutional layer XII, a BN layer XII, a convolutional layer XIII, a BN layer XIII, a ReLU activation function layer IX, and a BasicBlock residual layer IV, all with their output parameters configured as 256×2×2.
[0105] The sixth network structure includes an adaptive pooling layer and a linear layer arranged sequentially. The network layer output parameters of the adaptive pooling layer are all configured to be 256×1×1, and the network layer output parameters of the linear layer are all configured to be 5.
[0106] Furthermore, the color label prediction module maps the predicted N category indices to their corresponding color labels. When N color labels are obtained, the following steps are executed:
[0107] When the predicted category index is 0, the corresponding color label is determined to be a negative sample (NG).
[0108] When the predicted category index is 1, the corresponding color label is determined to be yellow;
[0109] When the predicted category index is 2, the corresponding color label is determined to be green;
[0110] When the predicted category index is 3, the corresponding color label is determined to be red;
[0111] When the predicted category index is 4, the corresponding color label is determined to be black.
[0112] Furthermore, the deep learning-based wiring sequence recognition system for power distribution examination cabinets also includes a wiring result detection module, which is used for:
[0113] Based on the obtained wire color sequence, determine whether the corresponding student's wiring operation is correct;
[0114] If the obtained wire color sequence matches the pre-stored wire color sequence, the corresponding student's wiring operation is determined to be correct.
[0115] If the obtained wire color sequence is inconsistent with the pre-stored wire color sequence, the corresponding student's wiring operation is determined to be incorrect.
[0116] It should be noted that line sequence recognition based on traditional algorithms first segments the wires using thresholding, then determines the HSV color range of the segmented wires, and sets an appropriate threshold to identify the wire colors. However, due to factors such as uneven lighting (as shown in Figure 7(a)) and diverse background colors (as shown in Figure 7(b)), the recognition accuracy of traditional algorithms is low and cannot be applied in practice.
[0117] To solve the above problems, this embodiment builds... Figure 2 The lightweight wiring sequence recognition network model shown has a model input of 50×50×3.
[0118] In one specific embodiment, the wiring sequence identification system for the power distribution examination cabinet based on deep learning is explained using the image of the wiring sequence identification area shown in Figure 8(a).
[0119] The image in Figure 7(a) is 892×50 after scaling. With a step size of 25, 36 rectangular images of 50×50 can be cropped, as shown in Figure 8(a).
[0120] The 36 rectangular images were used as a batch for inference testing. The data dimensions B×H×W×C were 36×50×50×3. After inference, 36 one-dimensional color arrays were obtained. The prediction results were obtained after calculation by the argmax function, as shown in Figure 8(b).
[0121] The values on the diagonal are the predicted category indices. These category indices are then mapped to color labels to obtain the visualization shown in Figure 8(c). Finally, only one identical and consecutive color label on the diagonal is retained, and negative samples (NG) are removed, resulting in the wire sequence identification result: "yellow-yellow-yellow-green-green-red-red-red-black". The correctness of the wiring is then determined based on the identified wire color sequence. During the test, the wire sequence identification time was approximately 3 milliseconds. The network model's inference speed test results are as follows: Figure 9 As shown;
[0122] The above analysis proves that the constructed lightweight wiring sequence identification network model and wiring sequence identification method have high accuracy and can still identify the correct wiring sequence under low light conditions.
[0123] In another specific embodiment, with attachment Figure 10 Using the wiring diagram of the power distribution test cabinet shown as an example, this paper explains the deep learning-based wiring sequence recognition system for power distribution test cabinets.
[0124] Figure 10 The three red boxes indicated by the middle arrow are the wiring sequence identification areas; (Excerpt from attached document) Figure 10 The diagram shows three wiring sequence identification areas. For the first image to be tested corresponding to each wiring sequence identification area, the image height H is scaled to h', where h' = 50, and the image width W is scaled proportionally to w' = (50 × W) ÷ H. Based on the above method, the attached... Figure 10 The diagrams of the three wiring sequence identification areas in the middle are used to identify the wire harnesses, resulting in the following: Figure 11 The recognition results are shown below;
[0125] The above analysis further proves that the constructed lightweight wiring sequence identification network model and wiring sequence identification method have high accuracy and can still identify the correct wiring sequence under conditions such as uneven lighting and diverse base plate colors.
[0126] In another specific embodiment, experiments were conducted on a self-built image dataset, totaling 16,000 images, including images of red, yellow, green, and black lines, as well as negative samples, all with a size of 50×50. Of these, 14,000 images were randomly allocated for training, and 2,000 images were used for evaluation and testing. The accuracy during model training was as follows: Figure 12 As shown, the loss curve is as follows Figure 13 As shown;
[0127] During model training, the gradient of the lightweight wiring sequence identification network model is calculated using the loss function and the model is optimized. The loss curve shows that the built model converges very quickly during training and tends to stabilize after 40 iterations. The model has high accuracy on the test set.
[0128] The loss function used is multivalued cross-entropy, and the formula is as follows:
[0129]
[0130] M is the number of categories, y ic The sign function is 0 or 1, where c is the true class of sample i and is 1 otherwise. ic This is the predicted probability that the observed sample belongs to category c.
[0131] This embodiment demonstrates through extensive experiments that the constructed lightweight wiring sequence recognition network model and wiring sequence recognition method have high accuracy. Even under conditions such as uneven lighting and diverse base plate colors, the correct wiring sequence can still be identified. This has significantly improved the accuracy of wiring sequence recognition in the industrial sector, and its real-time performance is very high, making it highly valuable for commercial applications.
[0132] Example 3
[0133] Based on the above embodiments, this embodiment also provides a readable storage medium storing instructions that, when executed by a processor, implement the steps of the deep learning-based wiring sequence identification method for power distribution examination cabinets as described in Embodiment 1.
[0134] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0135] Those skilled in the art will recognize that the algorithmic steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0136] If the above algorithm steps are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them; although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications can still be made to the specific implementation of the present invention or equivalent substitutions can be made to some technical features without departing from the spirit of the technical solutions of the present invention, and all such modifications and substitutions should be covered within the scope of the technical solutions claimed in the present invention.
Claims
1. A method for identifying the wiring sequence of a power distribution examination cabinet based on deep learning, characterized in that, Includes the following steps: Pre-build a lightweight wiring sequence recognition network model; After the student completes the wiring operation, the first image to be tested corresponding to the wiring sequence identification area is collected; wherein, the wiring sequence identification area refers to the wiring area of the power distribution test cabinet, the height of the first image to be tested is H, and the width of the first image to be tested is W. The recognition area of the first image to be tested is scaled to obtain the second image to be tested; wherein the height of the second image to be tested is h', the width of the second image to be tested is w', and w' = (h' × W) ÷ H; N 50×50 rectangular images are extracted from the second image to be tested, following a left-to-right order and a step size step; wherein the step size step = h'÷2; Input N 50×50 rectangular images into the lightweight wiring sequence recognition network model to obtain N one-dimensional color arrays; The argmax function is used to process the N one-dimensional color arrays output by the lightweight wiring sequence recognition network model to predict the category indices corresponding to the N rectangular images; The predicted N category indices are mapped to their corresponding color labels to obtain N color labels; different category indices and different color labels are pre-configured as a one-to-one mapping relationship; Remove adjacent and identical color tags from N color tags to obtain M target color tags; where M≤N; Remove the negative samples NG from the M target color labels to obtain the wire color order corresponding to the wiring sequence identification area.
2. The deep learning-based wiring sequence identification method for power distribution examination cabinets according to claim 1, characterized in that: The lightweight wiring sequence identification network model includes a first network structure, a second network structure, a third network structure, a fourth network structure, a fifth network structure, and a sixth network structure arranged sequentially, wherein, The first network structure includes a convolutional layer I, a batch normalization (BN) layer I, a ReLU activation function layer I, and a MaxPool pooling layer I arranged sequentially. The network layer output parameters of the convolutional layer I, the BN layer I, and the ReLU activation function layer I are all configured to be 64×25×25, and the network layer output parameters of the MaxPool pooling layer I are configured to be 64×13×13. The second network structure includes a convolutional layer II, a BN layer II, a ReLU activation function layer II, a convolutional layer III, a BN layer III, a convolutional layer IV, a BN layer IV, a ReLU activation function layer III, and a BasicBlock residual layer I, all arranged sequentially with network layer output parameters configured as 32×13×13. The third network structure includes, in sequence, a convolutional layer V, a BN layer V, a ReLU activation function layer IV, a convolutional layer VI, a BN layer VI, a convolutional layer VII, a BN layer VII, a ReLU activation function layer V, and a BasicBlock residual layer II, all with network layer output parameters configured as 64×7×7. The fourth network structure includes, in sequence, a convolutional layer VIII, a BN layer VIII, a ReLU activation function layer VI, a convolutional layer IX, a BN layer IX, a convolutional layer X, a BN layer X, a ReLU activation function layer VII, and a BasicBlock residual layer III, all with network layer output parameters configured as 128×4×4. The fifth network structure includes, in sequence, a convolutional layer XI, a BN layer XI, a ReLU activation function layer VIII, a convolutional layer XII, a BN layer XII, a convolutional layer XIII, a BN layer XIII, a ReLU activation function layer IX, and a BasicBlock residual layer IV, all with their output parameters configured as 256×2×2. The sixth network structure includes an adaptive pooling layer and a linear layer arranged sequentially. The network layer output parameters of the adaptive pooling layer are all configured to be 256×1×1, and the network layer output parameters of the linear layer are all configured to be 5.
3. The method for identifying the wiring sequence of a power distribution examination cabinet based on deep learning according to claim 1, characterized in that, Map the predicted N category indices to their corresponding color labels. When you have N color labels, execute: When the predicted category index is 0, the corresponding color label is determined to be a negative sample (NG). When the predicted category index is 1, the corresponding color label is determined to be yellow; When the predicted category index is 2, the corresponding color label is determined to be green; When the predicted category index is 3, the corresponding color label is determined to be red; When the predicted category index is 4, the corresponding color label is determined to be black.
4. The deep learning-based wiring sequence identification method for power distribution examination cabinets according to claim 3, characterized in that, When removing adjacent and identical color tags from N color tags to obtain M target color tags, execute: Determine if there are any adjacent and identical color labels among N color labels. If so, extract one of the adjacent and identical color labels as the target color label, and remove all other color labels except the target color label.
5. The method for identifying the wiring sequence of a power distribution examination cabinet based on deep learning according to claim 1, characterized in that, It also includes the following steps: Based on the obtained wire color sequence, determine whether the corresponding student's wiring operation is correct; If the obtained wire color sequence matches the pre-stored wire color sequence, the corresponding student's wiring operation is determined to be correct. If the obtained wire color sequence is inconsistent with the pre-stored wire color sequence, the corresponding student's wiring operation is determined to be incorrect.
6. A deep learning-based wiring sequence identification system for power distribution examination cabinets, characterized in that: It includes a network model management module, a test image acquisition module, a recognition region scaling module, a rectangular image cropping module, a color array prediction module, a category index prediction module, a color label prediction module, and a wire color order determination unit. The identification network model management module is used to pre-build a lightweight wiring sequence identification network model; The image acquisition module is used to acquire the first image to be tested corresponding to the wiring sequence identification area after the student completes the wiring operation; wherein, the wiring sequence identification area refers to the wiring area of the power distribution test cabinet, the height of the first image to be tested is H, and the width of the first image to be tested is W. The recognition region scaling module is used to scale the recognition region of the first image to be tested to obtain a second image to be tested; wherein, the height of the second image to be tested is h', the width of the second image to be tested is w', and w' = (h' × W) ÷ H; The rectangular image cropping module is used to crop N 50×50 rectangular images from the second image to be tested according to a left-to-right order and a step size step; wherein, the step size step = h'÷2; The color array prediction module is used to input N 50×50 rectangular images into the lightweight wiring sequence recognition network model to obtain N one-dimensional color arrays. The category index prediction module is used to process the N one-dimensional color arrays output by the lightweight wiring sequence recognition network model using the argmax function to predict the category indexes corresponding to the N rectangular images. The color label prediction module is used to map the predicted N category indices to their corresponding color labels to obtain N color labels; different category indices and different color labels are pre-configured as a one-to-one mapping relationship; The wire color order determination unit is used to remove adjacent and identical color labels from N color labels to obtain M target color labels; it is also used to remove negative samples NG from the M target color labels to obtain the wire color order corresponding to the wiring order identification area; where M≤N.
7. The deep learning-based wiring sequence identification system for power distribution examination cabinets according to claim 6, characterized in that: The identification network model management module pre-constructs a lightweight wiring sequence identification network model, which includes a first network structure, a second network structure, a third network structure, a fourth network structure, a fifth network structure, and a sixth network structure set sequentially. The first network structure includes a convolutional layer I, a batch normalization (BN) layer I, a ReLU activation function layer I, and a MaxPool pooling layer I arranged sequentially. The network layer output parameters of the convolutional layer I, the BN layer I, and the ReLU activation function layer I are all configured to be 64×25×25, and the network layer output parameters of the MaxPool pooling layer I are configured to be 64×13×13. The second network structure includes a convolutional layer II, a BN layer II, a ReLU activation function layer II, a convolutional layer III, a BN layer III, a convolutional layer IV, a BN layer IV, a ReLU activation function layer III, and a BasicBlock residual layer I, all arranged sequentially with network layer output parameters configured as 32×13×13. The third network structure includes, in sequence, a convolutional layer V, a BN layer V, a ReLU activation function layer IV, a convolutional layer VI, a BN layer VI, a convolutional layer VII, a BN layer VII, a ReLU activation function layer V, and a BasicBlock residual layer II, all with network layer output parameters configured as 64×7×7. The fourth network structure includes, in sequence, a convolutional layer VIII, a BN layer VIII, a ReLU activation function layer VI, a convolutional layer IX, a BN layer IX, a convolutional layer X, a BN layer X, a ReLU activation function layer VII, and a BasicBlock residual layer III, all with network layer output parameters configured as 128×4×4. The fifth network structure includes, in sequence, a convolutional layer XI, a BN layer XI, a ReLU activation function layer VIII, a convolutional layer XII, a BN layer XII, a convolutional layer XIII, a BN layer XIII, a ReLU activation function layer IX, and a BasicBlock residual layer IV, all with their output parameters configured as 256×2×2. The sixth network structure includes an adaptive pooling layer and a linear layer arranged sequentially. The network layer output parameters of the adaptive pooling layer are all configured to be 256×1×1, and the network layer output parameters of the linear layer are all configured to be 5.
8. The deep learning-based wiring sequence identification system for power distribution examination cabinets according to claim 6, characterized in that: The color label prediction module maps the predicted N category indices to their corresponding color labels. When N color labels are obtained, the following steps are executed: When the predicted category index is 0, the corresponding color label is determined to be a negative sample (NG). When the predicted category index is 1, the corresponding color label is determined to be yellow; When the predicted category index is 2, the corresponding color label is determined to be green; When the predicted category index is 3, the corresponding color label is determined to be red; When the predicted category index is 4, the corresponding color label is determined to be black.
9. The deep learning-based wiring sequence identification system for power distribution examination cabinets according to claim 6, characterized in that: It also includes a wiring result detection module, which is used for: Based on the obtained wire color sequence, determine whether the corresponding student's wiring operation is correct; If the obtained wire color sequence matches the pre-stored wire color sequence, the corresponding student's wiring operation is determined to be correct. If the obtained wire color sequence is inconsistent with the pre-stored wire color sequence, the corresponding student's wiring operation is determined to be incorrect.
10. A readable storage medium having instructions stored thereon, characterized in that: When executed by the processor, this instruction implements the steps of the deep learning-based wiring sequence identification method for power distribution examination cabinets as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Line sequence identification method and device based on image processing
CN113627431A
Line sequence identification detection method and system
CN114743086A