Terminal box appearance anomaly detection method, device and equipment, storage medium and program product
Through the terminal box appearance abnormality detection method, the detection network is used to detect the appearance abnormality of the terminal box in real time, which solves the problem of untimely traditional manual detection and realizes the timely and accurate detection of the terminal box appearance abnormality.
Patent Information
- Application Number
- CN202410950216.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-09-27
AI Technical Summary
Traditional terminal box appearance abnormality detection relies on manual regular inspections, which has the problem of untimely detection.
A terminal box appearance abnormality detection method is adopted, by obtaining the target appearance image of the terminal box to be detected, inputting it into the first detection network and the second detection network, and using the feature maps output by these networks to determine whether there is an appearance abnormality to achieve real-time detection. .
This method can timely and accurately detect appearance abnormalities of the terminal box, avoid the problem of untimely manual detection, and improve the real-time and accuracy of detection.
Smart Images

Figure CN118710631A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of monitoring and diagnosis of electrical equipment, and in particular to a method, device, equipment, storage medium and program product for detecting abnormal appearance of a terminal box. Background Art
[0002] As an important part of the power system, the terminal box's safety status directly affects the stable operation of the entire power system. Damage to the terminal box may lead to poor connection or contact, resulting in short circuit or leakage. Inspection of the terminal box's appearance is essential to maintaining the stability of the power system.
[0003] Traditionally, the maintenance and inspection of terminal boxes rely on manual regular inspections to detect whether the terminal boxes have abnormalities such as damage. However, traditional abnormality detection relies on manual labor and has the problem of untimely abnormality detection. Summary of the invention
[0004] Based on this, it is necessary to provide a terminal box appearance abnormality detection method, device, equipment, storage medium and program product that can timely detect abnormal terminal box appearance in order to solve the above technical problems.
[0005] In a first aspect, the present application provides a method for detecting abnormal appearance of a terminal box, the method comprising:
[0006] Acquire a target appearance image corresponding to the terminal box to be inspected;
[0007] Inputting the target appearance image into the first detection network and the second detection network respectively, obtaining a first feature map output by the first detection network and a second feature map output by the second detection network, wherein the first detection network and the second detection network are obtained by guided training based on appearance images of the same appearance state type;
[0008] According to the first characteristic diagram and the second characteristic diagram, it is determined whether the terminal box to be inspected has an appearance abnormality.
[0009] In one embodiment, the number of the first characteristic graphs is multiple, the number of the second characteristic graphs is multiple, and the characteristic dimension of the first characteristic graph is the same as the characteristic dimension of the second characteristic graph. The above-mentioned determining whether the terminal box to be detected has an appearance abnormality according to the first characteristic graph and the second characteristic graph includes:
[0010] For each first feature map, respectively calculating a loss quantization value between the first feature map and each second feature map;
[0011] Determine a first loss statistic corresponding to the first characteristic graph according to each loss quantization value;
[0012] It is determined whether the terminal box to be inspected has an appearance abnormality according to the first loss statistical value corresponding to each first characteristic graph.
[0013] In one embodiment, determining the first loss statistic corresponding to the first feature graph according to each loss quantization value includes:
[0014] Obtaining loss weight coefficients corresponding to the first feature map and each second feature map;
[0015] Statistical processing is performed on each loss quantization value according to each loss weight coefficient to obtain a first loss statistical value.
[0016] In one embodiment, determining whether the terminal box to be inspected has an appearance abnormality according to the first loss statistical value corresponding to each first characteristic graph includes:
[0017] Determine a second loss statistic according to the first loss statistic corresponding to each first characteristic graph;
[0018] According to the second loss statistic value, it is determined whether the terminal box to be inspected has an appearance abnormality.
[0019] In one embodiment, the appearance image of the same appearance state type is an appearance image of the terminal box in a normal appearance state, and the determining whether the terminal box to be detected has an appearance abnormality according to the second loss statistical value includes:
[0020] If the second loss statistic value is greater than the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0021] In one embodiment, the appearance image of the same appearance state type is an appearance image of the terminal box in an abnormal appearance state, and the determining whether the terminal box to be detected has an abnormal appearance according to the second loss statistical value includes:
[0022] If the second loss statistic is less than or equal to the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0023] In one embodiment, the step of obtaining a target appearance image corresponding to the terminal box to be inspected includes:
[0024] Acquire an initial appearance image corresponding to the terminal box to be inspected;
[0025] The initial appearance image is segmented to obtain the target appearance image.
[0026] In one embodiment, the method further comprises:
[0027] If it is determined that the terminal box to be inspected has an appearance abnormality, recognition processing is performed on the target appearance image to determine the abnormal area of the terminal box to be inspected.
[0028] In one embodiment, the method further comprises:
[0029] Acquire a normal appearance image set and an abnormal appearance image set, wherein the normal appearance image set includes a plurality of appearance images of terminal boxes having normal appearance states, and the abnormal appearance image set includes a plurality of appearance images of terminal boxes having abnormal appearance states;
[0030] The model is trained using a normal appearance image set or an abnormal appearance image set to obtain a first detection network and a second detection network.
[0031] In a second aspect, the present application also provides a terminal box appearance abnormality detection device, the device comprising:
[0032] An acquisition module, used to acquire a target appearance image corresponding to the terminal box to be detected;
[0033] A feature extraction module, used to input the target appearance image into the first detection network and the second detection network respectively, to obtain a first feature map output by the first detection network and a second feature map output by the second detection network, wherein the first detection network and the second detection network are obtained by guided training based on appearance images of the same appearance state type;
[0034] The detection module is used to determine whether the terminal box to be detected has an appearance abnormality based on the first characteristic map and the second characteristic map.
[0035] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in the first aspect are implemented.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0037] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method described in the first aspect above.
[0038] The above-mentioned terminal box appearance abnormality detection method, device, equipment, storage medium and program product obtains the target appearance image corresponding to the terminal box to be detected, and inputs the target appearance image into the first detection network and the second detection network respectively, to obtain the first feature map output by the first detection network and the second feature map output by the second detection network. The first detection network and the second detection network are obtained by guided training based on the appearance images of the same appearance state type. According to the first feature map and the second feature map, it is determined whether the terminal box to be detected has an appearance abnormality. In this method, by obtaining the target appearance image corresponding to the terminal box to be detected and determining whether the terminal box to be detected has an appearance abnormality according to the target appearance image, the appearance abnormality of the terminal box can be detected in real time. The method of detecting appearance abnormality through image has good real-time performance. Compared with the traditional method of manually detecting the appearance abnormality of the terminal box, it can avoid the problem of untimely manual detection and can detect the appearance abnormality of the terminal box in time. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] FIG1 is a schematic diagram of a process of a method for detecting abnormal appearance of a terminal box in one embodiment;
[0041] FIG2 is a schematic diagram of a flow chart of a method for detecting abnormal appearance of a terminal box in another embodiment;
[0042] FIG3 is a schematic diagram of a flow chart of a method for detecting abnormal appearance of a terminal box in another embodiment;
[0043] FIG4 is a schematic diagram of a flow chart of a method for detecting abnormal appearance of a terminal box in another embodiment;
[0044] FIG5 is a schematic diagram of a flow chart of a method for detecting abnormal appearance of a terminal box in another embodiment;
[0045] FIG6 is a schematic diagram of a flow chart of a method for detecting abnormal appearance of a terminal box in another embodiment;
[0046] FIG7 is a block diagram of a terminal box appearance abnormality detection device according to an embodiment;
[0047] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] As an important part of the power system, the terminal box's safety status directly affects the stable operation of the entire power system. Damage to the terminal box may lead to poor connection or contact, resulting in short circuit or leakage. Inspection of the terminal box's appearance is essential to maintaining the stability of the power system.
[0050] Traditionally, the maintenance and inspection of terminal boxes rely on regular manual inspections to detect whether the terminal boxes have abnormalities such as damage. However, this method is not only time-consuming and labor-intensive, but the frequency and quality of inspections are limited by the availability and professional skills of manual resources, and there is a problem of untimely abnormality detection.
[0051] Therefore, the embodiments of the present application provide a method, device, equipment, storage medium and program product for detecting abnormal appearance of a terminal box, which can solve the above-mentioned technical problems.
[0052] The terminal box appearance abnormality detection method provided in the embodiment of the present application can be used for computer equipment, which can be a server or a terminal. The server can be a single server or a server cluster composed of multiple servers. The terminal can be but is not limited to various personal computers, laptops, smart phones and tablet devices; the terminal box appearance abnormality detection method provided in the embodiment of the present application can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server.
[0053] In one embodiment, as shown in FIG1 , a method for detecting abnormal appearance of a terminal box is provided. The method is described by taking the method used in a computer device as an example. The method comprises the following steps:
[0054] S102, obtaining a target appearance image corresponding to the terminal box to be inspected.
[0055] Among them, the terminal box is a device used for electrical connection and distribution, which is commonly found in electrical control and distribution systems. It is used to provide a safe and orderly wiring environment so that electrical equipment, cables and wires can be effectively connected together, and current is introduced, distributed and transmitted through the terminal box. The terminal box to be detected is the terminal box photographed by the monitoring equipment, and the monitoring equipment is used to perform abnormal detection on the terminal box to be detected.
[0056] In an embodiment of the present application, a computer device can collect images of the terminal box to be detected taken by a monitoring device in real time, and pre-process the collected terminal box images to obtain a target appearance image corresponding to the terminal box to be detected. The target appearance image corresponding to the terminal box to be detected only includes the terminal box to be detected, and the background of the target appearance image is a solid color background, such as black or white.
[0057] In one possible implementation, the computer device may perform foreground target extraction processing on the collected terminal box image, extract the terminal box to be detected from the collected terminal box image, separate the terminal box to be detected from the background image, and obtain the target appearance image corresponding to the terminal box to be detected.
[0058] In another possible implementation, the computer device may remove background noise from the collected terminal box image, sharpen the defect structure, and perform image sharpening processing on the terminal box with the background noise removed to obtain a target appearance image corresponding to the terminal box to be inspected.
[0059] S104, inputting the target appearance image into the first detection network and the second detection network respectively, to obtain a first feature map output by the first detection network and a second feature map output by the second detection network.
[0060] Among them, the first detection network and the second detection network are obtained by guided training based on appearance images of the same appearance state type. The network structure complexity of the first detection network is greater than the network structure complexity of the second detection network, and the learning ability of the first detection network is better than the learning ability of the second detection network. For example, the first detection network is a teacher network, and the second detection network is a student network. The first detection network and the second detection network can be convolutional neural networks including multiple convolutional layers. Since the first detection network and the second detection network are obtained by guided training based on appearance images of the same appearance state type, the same appearance state type means that the appearance images used for training have the same appearance state type, and the appearance state type can include a normal appearance state type or an abnormal appearance state type, wherein the abnormal appearance state type means that the appearance of the terminal box has defects, that is, the terminal box has an abnormal appearance. The model parameters of the first detection network can be preloaded, for example, the model parameters of the first detection network can preload the model parameters of the trained neural network, so that the output of the first detection network can be used to guide the training of the second detection network.
[0061] In an embodiment of the present application, the computer device can input the target appearance image into the first detection network and the second detection network respectively. The first detection network includes multiple intermediate layers, each of which includes multiple network layers. The network layer can be a convolution layer, a pooling layer, a fully connected layer, etc. Exemplarily, the first detection network includes 5 intermediate layers, and the multiple intermediate layers are connected in sequence. The output of each intermediate layer is the input of the next intermediate layer. The second detection network also includes multiple intermediate layers, and the network parameters corresponding to the network layers in each intermediate layer included in the second detection network are different from the network parameters of the network layers in each intermediate layer included in the first detection network. The number of intermediate layers of the first detection network is the same as the number of intermediate layers of the second detection network. The computer device inputs the target appearance image into the first detection network, and each intermediate layer in the first detection network outputs a feature map, and the feature map output by each intermediate layer in the first detection network is used as the first feature map. At the same time, the computer device inputs the target appearance image into the second detection network, and each intermediate layer in the second detection network outputs a feature map, and the feature map output by each intermediate layer in the second detection network is used as the second feature map.
[0062] S106: Determine whether the terminal box to be inspected has an appearance abnormality based on the first characteristic graph and the second characteristic graph.
[0063] In an embodiment of the present application, the first detection network and the second detection network are obtained by guided training based on appearance images of the same appearance state type, that is, the feature output results of the first detection network and the second detection network for appearance images of the same appearance state type during training are consistent. If the appearance state type corresponding to the target appearance image is the same as the same appearance state type during training, the first feature map and the second feature map output by the first detection network and the second detection network for the target appearance image are consistent. If the appearance state type corresponding to the target appearance image is different from the same appearance state type during training, due to the different learning capabilities of the first detection network and the second detection network, the first feature map and the second feature map output by the first detection network and the second detection network for the target appearance image are different. Optionally, the computer device can determine whether there is an appearance abnormality in the terminal box to be detected based on the consistency or difference between the first feature map and the second feature map.
[0064] In one possible implementation, the computer device can calculate the feature matching degree between the first feature map and the second feature map, and determine whether there is an appearance abnormality in the terminal box to be inspected based on the feature matching degree between the first feature map and the second feature map and the appearance state type corresponding to the appearance images of the training first detection network and the second detection network.
[0065] In another possible implementation, the computer device may calculate the loss value between the first feature map and the second feature map, and determine whether there is an appearance abnormality in the terminal box to be inspected based on the loss value between the first feature map and the second feature map and the appearance state type corresponding to the appearance images for training the first detection network and the second detection network.
[0066] In the above-mentioned terminal box appearance abnormality detection method, by obtaining the target appearance image corresponding to the terminal box to be detected, the target appearance image is input into the first detection network and the second detection network respectively, and the first feature map output by the first detection network and the second feature map output by the second detection network are obtained. The first detection network and the second detection network are obtained by guided training based on the appearance images of the same appearance state type. According to the first feature map and the second feature map, it is determined whether the terminal box to be detected has an appearance abnormality. In this method, by obtaining the target appearance image corresponding to the terminal box to be detected and determining whether the terminal box to be detected has an appearance abnormality according to the target appearance image, the appearance abnormality of the terminal box can be detected in real time. The method of detecting appearance abnormality through image has good real-time performance. Compared with the traditional method of manually detecting the appearance abnormality of the terminal box, it can avoid the problem of untimely manual detection and can detect the appearance abnormality of the terminal box in time. The target appearance image is input into the first detection network and the second detection network respectively to obtain a first feature map output by the first detection network and a second feature map output by the second detection network. Based on the first feature map and the second feature map, it is determined whether the terminal box to be detected has an appearance abnormality. It is possible to accurately determine whether the terminal box to be detected has an appearance abnormality based on the first feature map and the second feature map. For example, it is determined whether the terminal box to be detected has an appearance abnormality through the loss value between the first feature map and the second feature map, thereby improving the accuracy of detecting appearance abnormalities of terminal wires.
[0067] In the above embodiment, it is mentioned that whether the terminal box to be detected has an appearance abnormality is determined based on the first characteristic map and the second characteristic map. Next, an implementation method of determining whether the terminal box to be detected has an appearance abnormality based on the first characteristic map and the second characteristic map is described.
[0068] Based on the embodiment shown in FIG. 1 , referring to FIG. 2 , the above S106 may include the following steps:
[0069] S202: For each first feature map, respectively calculate a loss quantization value between the first feature map and each second feature map.
[0070] Among them, the number of first feature maps is multiple, the number of second feature maps is multiple, and the feature dimension of the first feature map is the same as the feature dimension of the second feature map. The first feature map is a feature map output by multiple intermediate layers of the first detection network, and the second feature map is a feature map output by multiple intermediate layers of the second detection network. The number of intermediate layers included in the first detection network and the second detection network can be the same, and correspondingly, the feature dimension of the first feature map is the same as the feature dimension of the second feature map.
[0071] In an embodiment of the present application, a computer device can calculate a loss quantization value between each first feature map and each second feature map. For each first feature map, a loss quantization value between the first feature map and each second feature map is calculated. The loss quantization value may be the sum of the mean square error loss and the cosine similarity loss. The calculation of the loss quantization value between the first feature map and each second feature map may refer to formula (1).
[0072] Formula (1)
[0073] in, is the loss quantization value between the jth first feature map and each second feature map, is the jth first feature map and the i-th second feature map The mean square error loss between , the calculation of the mean square error loss can refer to formula (2), is the jth first feature map and the i-th second feature map The cosine similarity loss between them can be calculated by referring to formula (3).
[0074] Formula (2)
[0075] Formula (3)
[0076] in, is the vector in the feature map, It is a modulo operation.
[0077] S204: Determine a first loss statistic corresponding to the first feature map according to each loss quantization value.
[0078] In the embodiment of the present application, since the network structures of the intermediate layers in the first detection network and the second detection network are different, there are characteristic differences in the feature maps outputted by different intermediate layers, that is, between each first feature map and each second feature map, the characteristic difference gradually increases with the difference of the intermediate layers. For example, the five intermediate layers in the first detection network sequentially output four first feature maps. , the 5 intermediate layers in the second detection network output 4 second feature maps in turn , and , , and The feature difference between them gradually increases. In order to eliminate the influence of the feature difference between feature maps of different intermediate layers on the loss quantization value, the feature difference between each first feature map and each second feature map is suppressed to determine the first loss statistic corresponding to the first feature map.
[0079] In a possible implementation, a computer device may identify an index identifier or an intermediate layer identifier for identifying a first feature map and each second feature map. The index identifier or the intermediate layer identifier may be used to characterize the distance information between the feature maps. The feature distance between the first feature map and each second feature map is calculated based on the index identifier or the intermediate layer identifier of the first feature map and each second feature map. Different feature distances correspond to different suppression degrees, and the magnitude of the suppression degree is positively correlated with the magnitude of the feature distance. The computer device may suppress the loss quantization value between the first feature and each second feature map based on the suppression degree corresponding to the first feature map and each second feature map, sum the loss quantization values after the suppression process, and obtain a first loss statistic corresponding to the first feature map. The first loss statistic includes the sum of the loss quantization values between the first feature map and each second feature map.
[0080] In another possible implementation, as an optional embodiment, the computer device may obtain the loss weight coefficients corresponding to the first characteristic graph and each second characteristic graph; perform statistical processing on each loss quantization value according to each loss weight coefficient to obtain a first loss statistical value.
[0081] Among them, the loss weight coefficient corresponding to the first feature map and each second feature map is the weight value of the loss quantization value between the first feature map and each second feature map. In an embodiment of the present application, the computer device can determine the weight of the loss quantization value between the first feature map and each second feature map based on the feature difference between the first feature map and each second feature map to obtain the loss weight coefficient corresponding to the first feature map and each second feature map, or, using a semantic matching network, determine the loss weight coefficient based on the similarity of each intermediate layer in the first detection network and the second detection network. The loss weight coefficients corresponding to the first feature map and each second feature map are weighted and summed with the loss quantization values between the first feature map and each second feature map to obtain a first loss statistic.
[0082] S206: Determine whether the terminal box to be inspected has an appearance abnormality according to the first loss statistical value corresponding to each first characteristic graph.
[0083] In an embodiment of the present application, for appearance images of the same appearance state type when the first detection network and the second detection network are trained, the first detection network and the second detection network have similar feature extraction capabilities for appearance images of the same appearance type during training, that is, for appearance images of the same appearance state type during training, if the appearance state type of the target appearance image is the same as the appearance state type of the appearance image during training, the difference between the first feature map output by the first detection network and the second feature map output by the second detection network is small, because, during the training process, the first detection network and the second detection network both learn the image content of appearance images with the same appearance type, and for the appearance images of the learned appearance type, the features extracted by the two are consistent. For example, during the training process, the first detection network and the second detection network both learn the image content of appearance images of abnormal appearance types. When the target appearance image is of abnormal appearance image type, the first detection network and the second detection network perform feature extraction on the target appearance image, and the difference between the corresponding first image features and the second image features is small, and it can be concluded that the first loss statistic between each first feature map and each second feature map is small.
[0084] If the appearance state type of the target appearance image is different from the appearance state type of the appearance image during training, the difference between the first feature map output by the first detection network and the second feature map output by the second detection network is relatively large, because, during the training process, the first detection network and the second detection network both learned the image content of the appearance image with the same appearance type, but the learning ability of the first detection network is better than that of the second detection network. When faced with the appearance image of the appearance type that the first detection network and the second detection network have not learned, the features extracted by the two are different. For example, during the training process, the first detection network and the second detection network both learned the image content of the appearance image of the abnormal appearance type. When the target appearance image is of the normal appearance image type, the first detection network and the second detection network extract features of the target appearance image, and the difference between the corresponding first image features and the second image features is relatively large, and it can be concluded that the first loss statistic between each first feature map and each second feature map is relatively large.
[0085] Based on this, the computer device can determine whether the terminal box to be inspected has an appearance abnormality according to the size of the first loss statistical value corresponding to each first characteristic graph.
[0086] In a possible implementation, a computer device may obtain a first loss threshold corresponding to a first loss statistic corresponding to each first characteristic graph, determine the proportion of the first loss statistic corresponding to each first characteristic graph that is greater than the first loss statistic corresponding to the first loss threshold, and determine whether the terminal box to be inspected has an appearance abnormality based on the relationship between the proportion and the proportion threshold.
[0087] In another possible implementation, the computer device may perform statistical processing on the first loss statistics corresponding to each first characteristic graph to obtain the sum of losses corresponding to each first characteristic graph, and determine whether the terminal box to be inspected has an appearance abnormality based on the size of the sum of losses.
[0088] In this way, through the above method, the first loss statistic corresponding to the first characteristic graph is determined according to the loss quantification value between the first characteristic graph and each second characteristic graph, and the difference between the first characteristic graph and each second characteristic graph can be determined according to the first loss statistic. According to the loss quantification value between the first characteristic graph and each second characteristic graph, it is possible to accurately detect whether there is an appearance abnormality in the terminal box to be inspected, thereby ensuring the accuracy of detection.
[0089] In the above embodiment, it is mentioned that the first loss statistics corresponding to each first characteristic graph is used to determine whether the terminal box to be detected has an appearance abnormality. Next, an implementation method of determining whether the terminal box to be detected has an appearance abnormality according to the first loss statistics corresponding to each first characteristic graph is described.
[0090] Based on the embodiment shown in FIG. 2 , referring to FIG. 3 , the above S206 may include the following steps:
[0091] S302: Determine a second loss statistic according to the first loss statistic corresponding to each first characteristic graph.
[0092] In the embodiment of the present application, the computer device may perform weighted summation on the first loss statistics corresponding to each first feature graph to obtain a second loss statistics. The calculation of the second loss statistics may refer to formula (4).
[0093] Formula (4)
[0094] in, is the loss weight coefficient, and L is the second loss statistic.
[0095] S304: Determine whether the terminal box to be inspected has an appearance abnormality according to the second loss statistical value.
[0096] In an embodiment of the present application, the computer device can determine whether the terminal box to be inspected has an appearance abnormality based on the size of the second loss statistic and the loss threshold and the appearance state type corresponding to the appearance image of the same appearance state type.
[0097] As an optional embodiment, the appearance image of the same appearance state type is the appearance image of the terminal box in a normal appearance state. If the second loss statistic is greater than the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality. Among them, the appearance image of the same appearance state type is the appearance image of the terminal box in a normal appearance state, which indicates that the first detection network and the second detection network learn the appearance image in a normal appearance state during the training process. If the corresponding second loss statistic is less than or equal to the loss threshold, the target appearance image has the same appearance state type as the appearance image during training, and it is determined that the terminal box to be detected has no appearance abnormality. If the corresponding second loss statistic is greater than the loss threshold, the target appearance image has a different appearance state type from the appearance image during training, and it is determined that the terminal box to be detected has an appearance abnormality.
[0098] As an optional embodiment, the appearance image of the same appearance state type is the appearance image of the terminal box in an abnormal appearance state. If the second loss statistic is less than or equal to the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality. Among them, the appearance image of the same appearance state type is the appearance image of the terminal box in an abnormal appearance state, which indicates that the first detection network and the second detection network learn the appearance image in an abnormal appearance state during the training process. If the corresponding second loss statistic is less than or equal to the loss threshold, the target appearance image has the same appearance state type as the bent pipe image during training, and it is determined that the terminal box to be detected has an appearance abnormality. If the corresponding second loss statistic is greater than the loss threshold, the target appearance image has a different appearance state type from the appearance image during training, and it is determined that the terminal box to be detected does not have an appearance abnormality.
[0099] As an optional embodiment, if it is determined that the terminal box to be inspected has an abnormal appearance, the target appearance image is identified and processed to determine the abnormal area of the terminal box to be inspected. In the embodiment of the present application, the computer device can use the detection model to identify the target appearance image, identify the abnormal area in the target appearance image, and mark the identified abnormal area in the target appearance image so that the operator can further check or take measures.
[0100] In this way, through the above method, it is possible to accurately determine whether the terminal box to be inspected has an appearance abnormality based on the second loss statistical value. When the appearance images of the same appearance state type are different types of appearance images, it is possible to accurately determine whether the terminal box to be inspected has an appearance abnormality based on the size of the second loss value.
[0101] The above embodiment mentions obtaining a target appearance image corresponding to the terminal box to be detected. Next, an implementation method of obtaining a target appearance image corresponding to the terminal box to be detected by a computer device is described.
[0102] Based on the embodiment shown in FIG. 1 , referring to FIG. 4 , the above S102 may include the following steps:
[0103] S402: Acquire an initial appearance image corresponding to the terminal box to be inspected.
[0104] The initial appearance image is an image of the terminal box to be detected taken by the monitoring device, and the initial appearance image includes the terminal box to be detected and objects around the terminal box. The computer device can collect the initial appearance image corresponding to the terminal box to be detected through the monitoring device.
[0105] S404, performing segmentation processing on the initial appearance image to obtain a target appearance image.
[0106] In an embodiment of the present application, a computer device can perform image segmentation processing on the initial appearance image, segment an image area that only includes the terminal box to be inspected from the initial appearance image, and background process other areas in the initial appearance image except the image area of the terminal box to be inspected to obtain a target appearance image.
[0107] In this way, through the above method, the influence of background noise on the accuracy of the detection results can be avoided. By segmenting the initial appearance image to obtain the target appearance image, the structure of the terminal box in the target appearance image can be highlighted, thereby improving the accuracy of appearance anomaly detection.
[0108] The above embodiment mentions the first detection network and the second detection network. Next, an implementation method of training the first detection network and the second detection network by a computer device is described.
[0109] Referring to FIG. 5 , the method for detecting abnormal appearance of a terminal box in the embodiment of the present application may further include the following steps:
[0110] S502: Acquire a set of normal appearance images and a set of abnormal appearance images.
[0111] The normal appearance image set includes a plurality of appearance images of terminal boxes with normal appearance states, and the abnormal appearance image set includes a plurality of appearance images of terminal boxes with abnormal appearance states.
[0112] In an embodiment of the present application, a computer device can obtain appearance images of different terminal boxes at different times through a monitoring device, and classify the obtained appearance images of different terminal boxes into normal appearance images and abnormal appearance images. The terminal boxes in each normal appearance image and each abnormal appearance image are segmented to obtain segmented normal appearance images and abnormal appearance images. The segmented normal appearance images and abnormal appearance images are subjected to rotation transformation, affine transformation, etc., to expand the data set to obtain a normal appearance image set and an abnormal appearance image set. Most of the appearance images in the normal appearance image set are used as a training set, or most of the appearance images in the abnormal appearance image set are used as a training set, and some appearance images are selected from the normal appearance images and the abnormal appearance images as a test set. For example, the training set includes 2646 normal appearance images, the test set includes 320 normal appearance images, and the test set includes 205 abnormal appearance images. In this way, the number of appearance images in the training set is increased, sufficient gradient information is provided for training, and the target shape in the training set is enriched, so that the network focuses less on the target contour.
[0113] S504: Perform model training using the normal appearance image set or the abnormal appearance image set to obtain a first detection network and a second detection network.
[0114] In an embodiment of the present application, a computer device can use a normal appearance image set or an abnormal appearance image set to train two different neural networks to obtain a first detection network and a second detection network. The first detection network and the second detection network can be residual networks. During the training process, an unsupervised training method is adopted, and a normal appearance image set or an abnormal appearance image set is input without inputting labels corresponding to the normal appearance image set or the abnormal appearance image set, so that the first detection network and the second detection network learn the image distribution data in the normal appearance image set or the abnormal appearance image set.
[0115] During the training stage, only images in the normal appearance image set or the abnormal appearance image set are input to the first detection network and the second detection network, and constrained training is performed by matching the output values of the first detection network and the second detection network at a specific intermediate layer on two scales, namely, mean square error loss and pre-similarity loss, to obtain the first detection network and the second detection network.
[0116] In this way, by continuously collecting and updating normal and abnormal appearance images in the above way, the performance and robustness of the model can be optimized. As the data set grows, the performance of the model in real scenarios will become more and more reliable.
[0117] In one embodiment, a method for detecting abnormal appearance of a terminal box is provided, which is used for computer equipment. Referring to FIG. 6 , the method comprises the following steps:
[0118] S601, obtaining an initial appearance image corresponding to the terminal box to be inspected;
[0119] S602, performing segmentation processing on the initial appearance image to obtain a target appearance image;
[0120] S603, inputting the target appearance image into the first detection network and the second detection network respectively, to obtain a first feature map output by the first detection network and a second feature map output by the second detection network;
[0121] S604, for each first feature map, respectively calculating a loss quantization value between the first feature map and each second feature map;
[0122] S605, obtaining loss weight coefficients corresponding to the first feature map and each second feature map;
[0123] S606, performing statistical processing on each loss quantization value according to each loss weight coefficient to obtain a first loss statistical value;
[0124] S607, determining a second loss statistic value according to the first loss statistic value corresponding to each first characteristic graph;
[0125] S608, the appearance image of the same appearance state type is an appearance image of the terminal box in a normal appearance state, and if the second loss statistical value is greater than the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality;
[0126] S609, the appearance image of the same appearance state type is an appearance image of the terminal box in an abnormal appearance state, and if the second loss statistic value is less than or equal to the loss threshold, it is determined that the terminal box to be detected has an abnormal appearance;
[0127] S610: If it is determined that the terminal box to be inspected has an appearance abnormality, recognition processing is performed on the target appearance image to determine the abnormal area of the terminal box to be inspected.
[0128] The following is an exemplary description of the implementation of the terminal box appearance abnormality detection method according to the above embodiment.
[0129] As shown in FIG6 , an initial appearance image corresponding to the terminal box to be detected is obtained, and the initial appearance image is segmented to obtain a target appearance image. The target appearance image is respectively input into the first detection network and the second detection network to obtain a first feature map output by the first detection network and a second feature map output by the second detection network. For each first feature map, the loss quantization value between the first feature map and each second feature map is calculated respectively, and the loss weight coefficient corresponding to the first feature map and each second feature map is obtained. According to each loss weight coefficient, each loss quantization value is statistically processed to obtain a first loss statistic value. According to the first loss statistic value corresponding to each first feature map, a second loss statistic value is determined. The appearance image of the same appearance state type is the appearance image of the terminal box in a normal appearance state. If the second loss statistic value is greater than the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality. The appearance image of the same appearance state type is the appearance image of the terminal box in an abnormal appearance state. If the second loss statistic value is less than or equal to the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality. If it is determined that the terminal box to be detected has an appearance abnormality, the target appearance image is identified to determine the abnormal area of the terminal box to be detected.
[0130] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0131] Based on the same inventive concept, the embodiment of the present application also provides a terminal box appearance abnormality detection device for implementing the terminal box appearance abnormality detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more terminal box appearance abnormality detection device embodiments provided below can refer to the limitations of the terminal box appearance abnormality detection method above, and will not be repeated here.
[0132] In one embodiment, as shown in FIG. 7 , a terminal box appearance abnormality detection device is provided, comprising: an acquisition module 701 , a feature extraction module 702 , and a detection module 703 , wherein:
[0133] An acquisition module 701 is used to acquire a target appearance image corresponding to a terminal box to be detected;
[0134] A feature extraction module 702 is used to input the target appearance image into the first detection network and the second detection network respectively, to obtain a first feature map output by the first detection network and a second feature map output by the second detection network, wherein the first detection network and the second detection network are obtained by guiding training based on appearance images of the same appearance state type;
[0135] The detection module 703 is used to determine whether the terminal box to be detected has an appearance abnormality according to the first characteristic map and the second characteristic map.
[0136] In another embodiment, another terminal box appearance abnormality detection device is provided. On the basis of the above embodiment, the number of first feature graphs is multiple, the number of second feature graphs is multiple, and the feature dimension of the first feature graph is the same as the feature dimension of the second feature graph. The above detection module 703 includes a calculation unit, a first determination unit and a second determination unit, wherein:
[0137] A calculation unit, configured to calculate, for each first feature map, a loss quantization value between the first feature map and each second feature map;
[0138] A first determining unit, configured to determine a first loss statistic corresponding to the first feature map according to each loss quantization value;
[0139] The second determination unit is used to determine whether the terminal box to be detected has an appearance abnormality according to the first loss statistical value corresponding to each first characteristic graph.
[0140] Optionally, the first determining unit is specifically configured to:
[0141] Obtaining loss weight coefficients corresponding to the first feature map and each second feature map;
[0142] Statistical processing is performed on each loss quantization value according to each loss weight coefficient to obtain a first loss statistical value.
[0143] Optionally, the second determining unit is specifically configured to:
[0144] Determine a second loss statistic according to the first loss statistic corresponding to each first characteristic graph;
[0145] According to the second loss statistic value, it is determined whether the terminal box to be inspected has an appearance abnormality.
[0146] Optionally, the appearance image of the same appearance state type is an appearance image of the terminal box in a normal appearance state, and the second determining unit is further specifically used to:
[0147] If the second loss statistic value is greater than the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0148] Optionally, the appearance image of the same appearance state type is an appearance image of the terminal box in an abnormal appearance state, and the second determining unit is further specifically used to:
[0149] If the second loss statistic is less than or equal to the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0150] In another embodiment, another terminal box appearance abnormality detection device is provided. Based on the above embodiment, the acquisition module 701 includes an acquisition unit and a segmentation unit, wherein:
[0151] An acquisition unit, used for acquiring an initial appearance image corresponding to the terminal box to be detected;
[0152] The segmentation unit is used to perform segmentation processing on the initial appearance image to obtain a target appearance image.
[0153] In another embodiment, another terminal box appearance abnormality detection device is provided. Based on the above embodiment, the above device further includes an identification module, wherein:
[0154] The recognition module is used to perform recognition processing on the target appearance image to determine the abnormal area of the terminal box to be detected if it is determined that the terminal box to be detected has an abnormal appearance.
[0155] In another embodiment, another terminal box appearance abnormality detection device is provided. Based on the above embodiment, the device further includes a set acquisition module and a training module, wherein:
[0156] A set acquisition module, used to acquire a normal appearance image set and an abnormal appearance image set, wherein the normal appearance image set includes a plurality of appearance images of terminal boxes with normal appearance states, and the abnormal appearance image set includes a plurality of appearance images of terminal boxes with abnormal appearance states;
[0157] The training module is used to perform model training using a normal appearance image set or an abnormal appearance image set to obtain a first detection network and a second detection network.
[0158] Each module in the terminal box appearance abnormality detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0159] In an exemplary embodiment, a computer device is provided, which can be a terminal or a server. Taking a terminal as an example, its internal structure diagram can be shown in FIG8. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a terminal box appearance abnormality detection method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a key, a trackball or a touch pad set on the housing of the computer device, or an external keyboard, touch pad or mouse.
[0160] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0161] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0162] Obtain a target appearance image corresponding to a terminal box to be inspected; input the target appearance image into a first detection network and a second detection network respectively to obtain a first feature map output by the first detection network and a second feature map output by the second detection network, wherein the first detection network and the second detection network are trained based on appearance images of the same appearance state type; determine whether the terminal box to be inspected has an appearance abnormality based on the first feature map and the second feature map.
[0163] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0164] For each first characteristic graph, respectively calculate the loss quantification value between the first characteristic graph and each second characteristic graph; determine the first loss statistical value corresponding to the first characteristic graph based on each loss quantification value; and determine whether the terminal box to be inspected has an appearance abnormality based on the first loss statistical value corresponding to each first characteristic graph.
[0165] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0166] Obtain loss weight coefficients corresponding to the first characteristic graph and each second characteristic graph; perform statistical processing on each loss quantization value according to each loss weight coefficient to obtain a first loss statistical value.
[0167] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0168] According to the first loss statistical values corresponding to the first characteristic diagrams, the second loss statistical values are determined; and according to the second loss statistical values, it is determined whether the terminal box to be inspected has an appearance abnormality.
[0169] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0170] If the second loss statistic value is greater than the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0171] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0172] If the second loss statistic is less than or equal to the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0173] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0174] An initial appearance image corresponding to the terminal box to be inspected is obtained; and the initial appearance image is segmented to obtain a target appearance image.
[0175] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0176] If it is determined that the terminal box to be inspected has an appearance abnormality, recognition processing is performed on the target appearance image to determine the abnormal area of the terminal box to be inspected.
[0177] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0178] Acquire a normal appearance image set and an abnormal appearance image set, wherein the normal appearance image set includes a plurality of appearance images of terminal boxes having normal appearance states, and the abnormal appearance image set includes a plurality of appearance images of terminal boxes having abnormal appearance states;
[0179] The model is trained using a normal appearance image set or an abnormal appearance image set to obtain a first detection network and a second detection network.
[0180] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0181] Obtain a target appearance image corresponding to a terminal box to be inspected; input the target appearance image into a first detection network and a second detection network respectively to obtain a first feature map output by the first detection network and a second feature map output by the second detection network, wherein the first detection network and the second detection network are trained based on appearance images of the same appearance state type; determine whether the terminal box to be inspected has an appearance abnormality based on the first feature map and the second feature map.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] For each first characteristic graph, respectively calculate the loss quantification value between the first characteristic graph and each second characteristic graph; determine the first loss statistical value corresponding to the first characteristic graph based on each loss quantification value; and determine whether the terminal box to be inspected has an appearance abnormality based on the first loss statistical value corresponding to each first characteristic graph.
[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0185] Obtain loss weight coefficients corresponding to the first characteristic graph and each second characteristic graph; perform statistical processing on each loss quantization value according to each loss weight coefficient to obtain a first loss statistical value.
[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0187] According to the first loss statistical values corresponding to the first characteristic diagrams, the second loss statistical values are determined; and according to the second loss statistical values, it is determined whether the terminal box to be inspected has an appearance abnormality.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0189] If the second loss statistic value is greater than the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0190] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0191] If the second loss statistic is less than or equal to the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0193] An initial appearance image corresponding to the terminal box to be inspected is obtained; and the initial appearance image is segmented to obtain a target appearance image.
[0194] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0195] If it is determined that the terminal box to be inspected has an appearance abnormality, recognition processing is performed on the target appearance image to determine the abnormal area of the terminal box to be inspected.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0197] Acquire a normal appearance image set and an abnormal appearance image set, wherein the normal appearance image set includes a plurality of appearance images of terminal boxes having normal appearance states, and the abnormal appearance image set includes a plurality of appearance images of terminal boxes having abnormal appearance states;
[0198] The model is trained using a normal appearance image set or an abnormal appearance image set to obtain a first detection network and a second detection network.
[0199] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0200] Obtain a target appearance image corresponding to a terminal box to be inspected; input the target appearance image into a first detection network and a second detection network respectively to obtain a first feature map output by the first detection network and a second feature map output by the second detection network, wherein the first detection network and the second detection network are trained based on appearance images of the same appearance state type; determine whether the terminal box to be inspected has an appearance abnormality based on the first feature map and the second feature map.
[0201] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0202] For each first characteristic graph, respectively calculate the loss quantification value between the first characteristic graph and each second characteristic graph; determine the first loss statistical value corresponding to the first characteristic graph based on each loss quantification value; and determine whether the terminal box to be inspected has an appearance abnormality based on the first loss statistical value corresponding to each first characteristic graph.
[0203] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0204] Obtain loss weight coefficients corresponding to the first characteristic graph and each second characteristic graph; perform statistical processing on each loss quantization value according to each loss weight coefficient to obtain a first loss statistical value.
[0205] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0206] According to the first loss statistical values corresponding to the first characteristic diagrams, the second loss statistical values are determined; and according to the second loss statistical values, it is determined whether the terminal box to be inspected has an appearance abnormality.
[0207] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0208] If the second loss statistic value is greater than the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0209] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0210] If the second loss statistic is less than or equal to the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
[0211] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0212] An initial appearance image corresponding to the terminal box to be inspected is obtained; and the initial appearance image is segmented to obtain a target appearance image.
[0213] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0214] If it is determined that the terminal box to be inspected has an appearance abnormality, recognition processing is performed on the target appearance image to determine the abnormal area of the terminal box to be inspected.
[0215] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0216] Acquire a normal appearance image set and an abnormal appearance image set, wherein the normal appearance image set includes a plurality of appearance images of terminal boxes having normal appearance states, and the abnormal appearance image set includes a plurality of appearance images of terminal boxes having abnormal appearance states;
[0217] The model is trained using a normal appearance image set or an abnormal appearance image set to obtain a first detection network and a second detection network.
[0218] It should be noted that the data involved in this application (including but not limited to data used for analysis, storage, display, etc.) are all data fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0219] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0220] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0221] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for detecting abnormal appearance of a terminal box, characterized in that: The method comprises: Acquire a target appearance image corresponding to the terminal box to be inspected; Inputting the target appearance image into a first detection network and a second detection network respectively, obtaining a first feature map output by the first detection network and a second feature map output by the second detection network, wherein the first detection network and the second detection network are obtained by guided training based on appearance images of the same appearance state type; According to the first characteristic diagram and the second characteristic diagram, it is determined whether the terminal box to be inspected has an appearance abnormality.
2. The method according to claim 1, characterized in that The number of the first characteristic graphs is multiple, the number of the second characteristic graphs is multiple, and the characteristic dimension of the first characteristic graph is the same as the characteristic dimension of the second characteristic graph, and determining whether the terminal box to be detected has an appearance abnormality according to the first characteristic graph and the second characteristic graph includes: For each of the first feature maps, respectively calculating a loss quantization value between the first feature map and each of the second feature maps; Determining a first loss statistic corresponding to the first feature map according to each of the loss quantization values; It is determined whether the terminal box to be inspected has an appearance abnormality according to the first loss statistic value corresponding to each of the first characteristic graphs.
3. The method according to claim 2, characterized in that The determining, according to each of the loss quantization values, a first loss statistic corresponding to the first feature graph includes: Obtaining loss weight coefficients corresponding to the first feature map and each of the second feature maps; Statistical processing is performed on each of the loss quantization values according to each of the loss weight coefficients to obtain the first loss statistical value.
4. The method according to claim 2, characterized in that: The determining, according to the first loss statistics corresponding to each of the first characteristic graphs, whether the terminal box to be detected has an appearance abnormality includes: determining a second loss statistic according to the first loss statistic corresponding to each of the first characteristic graphs; It is determined whether the terminal box to be inspected has an appearance abnormality according to the second loss statistic value.
5. The method according to claim 4, characterized in that The appearance image of the same appearance state type is an appearance image of the terminal box in a normal appearance state, and determining whether the terminal box to be detected has an appearance abnormality according to the second loss statistical value includes: If the second loss statistic is greater than the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
6. The method according to claim 5, characterized in that The appearance image of the same appearance state type is an appearance image of the terminal box in an abnormal appearance state, and determining whether the terminal box to be detected has an abnormal appearance according to the second loss statistical value includes: If the second loss statistic is less than or equal to the loss threshold, it is determined that the terminal box to be detected has an appearance abnormality.
7. The method according to claim 1, characterized in that The step of obtaining a target appearance image corresponding to the terminal box to be detected includes: Acquire an initial appearance image corresponding to the terminal box to be detected; The initial appearance image is segmented to obtain the target appearance image.
8. The method according to claim 1, characterized in that The method further comprises: If it is determined that the terminal box to be detected has an abnormal appearance, recognition processing is performed on the target appearance image to determine the abnormal area of the terminal box to be detected.
9. The method according to claim 1, characterized in that: The method further comprises: Acquire a normal appearance image set and an abnormal appearance image set, wherein the normal appearance image set includes a plurality of appearance images of terminal boxes having a normal appearance state, and the abnormal appearance image set includes a plurality of appearance images of terminal boxes having an abnormal appearance state; Model training is performed using the normal appearance image set or the abnormal appearance image set to obtain the first detection network and the second detection network.
10. A terminal box appearance abnormality detection device, characterized in that: The device comprises: An acquisition module, used to acquire a target appearance image corresponding to the terminal box to be detected; A feature extraction module, used to input the target appearance image into a first detection network and a second detection network respectively, to obtain a first feature map output by the first detection network and a second feature map output by the second detection network, wherein the first detection network and the second detection network are obtained by guided training based on appearance images of the same appearance state type; A detection module is used to determine whether the terminal box to be detected has an appearance abnormality based on the first characteristic map and the second characteristic map.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Defect detection method and device, defect training method and device, storage medium and equipment
CN115375618A
Defect detection method, defect detection system, and defect detection program
JP7036477B1
Power optimizer with protection circuit for solar power generation system
KR102301613B1
Cited By
Method and device for generating abnormal image of terminal box of transformer substation and computer equipment
CN122657650A
Abnormal image generation method, device and computer equipment for transformer substation terminal box
CN122657650B
