Fault information marking method and related equipment
By receiving equipment monitoring videos in real time and using a generative pre-training model to automatically label fault areas, it solves the problems of low manual labeling efficiency and inaccurate descriptions, and improves the performance and operation and maintenance efficiency of the fault detection system.
Patent Information
- Application Number
- CN202410522168.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-04-28
AI Technical Summary
In the existing technology, manual scheduled inspection of equipment results in low fault detection annotation efficiency and inaccurate description, which affects the performance of the fault detection system, and the readability of computer vision detection results is poor, resulting in low equipment operation and maintenance efficiency.
By receiving equipment monitoring video in real time, the image of the fault area is determined, prompt data is constructed and input into the pre-trained generative pre-training model, predictive description information is generated, the fault area is automatically marked, and the readability of fault information and operation and maintenance efficiency are improved.
It improves the annotation efficiency and accuracy of the fault detection system, generates predictive description information that conforms to natural language logic, facilitates operation and maintenance personnel to understand fault information, and improves equipment operation and maintenance efficiency.
Smart Images

Figure CN118314574B
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent manufacturing technology, specifically to the field of fault detection technology, and in particular to a fault information labeling method, device and electronic equipment. Background Art
[0002] At present, with the widespread use of monitoring equipment, continuous fault detection of equipment has become an important part of ensuring equipment reliability and production safety.
[0003] At present, equipment is usually inspected regularly by humans, and the detected equipment fault images are analyzed and annotated manually. However, the traditional fault information annotation method has problems such as low annotation efficiency and inaccurate description, which restricts the performance of the fault detection system. When using computer vision to detect equipment faults, the readability of the detection results is poor, resulting in low equipment operation and maintenance efficiency. Summary of the invention
[0004] In view of the above, it is necessary to propose a fault information marking method and related equipment to solve the technical problem of low accuracy in making production scheduling plans. The related equipment includes a fault information marking device and an electronic device.
[0005] The present application provides a fault information labeling method, which is applied to electronic equipment. The method includes: receiving a monitoring video of a device to be detected in real time, wherein the monitoring video includes multiple video frames; determining a fault image containing a fault area from the multiple video frames; constructing prompt data according to the fault image and a pre-stored prompt template; inputting the prompt data into a pre-trained generative pre-trained model to obtain prediction description information corresponding to the fault image; and labeling the fault area in the fault image according to the prediction description information.
[0006] In some embodiments, determining the fault image including the fault area from the multiple video frames includes: constructing key frames based on the multiple video frames; inputting the key frames into a fault detection model to obtain the fault image including the fault area.
[0007] In some embodiments, determining the key frames among the multiple video frames includes: determining the difference between every two adjacent video frames; determining a difference threshold based on the difference, including: determining the mean and standard deviation of the difference, and determining the difference between the mean and three times the standard deviation as the difference threshold; when the difference between any two adjacent video frames is less than the difference threshold, determining the any two adjacent video frames as candidate frames; and obtaining the key frame by fusing the candidate frames.
[0008] In some embodiments, the method further includes the step of training a fault detection model, wherein the step of training a fault detection model includes: inputting a training image into a pre-built initial detection model to obtain predicted fault information corresponding to the training image; wherein the predicted fault information includes at least predicted pixel coordinates and the probability that the predicted pixel belongs to a preset fault category; calculating a first loss value of the initial detection model according to the predicted fault and a pre-stored fault label, wherein the pre-stored fault label includes label pixel coordinates and the fault category of the label pixel; wherein the calculation method of the first loss value satisfies the following relationship: , where Loss represents the first loss value; i represents the index of the predicted pixel point; m represents the number of predicted pixels; j represents the index of the label pixel point; n represents the number of label pixels; C i represents the coordinates of the i-th predicted pixel; D j Represents the coordinates of the jth label pixel; represents the Euclidean distance between the coordinates of the i-th predicted pixel and the coordinates of the j-th labeled pixel; s represents the index of the fault category; r represents the number of fault categories; y s represents the symbol function. When the fault category of the label pixel is the sth fault category, y s is 1, when the fault category of the label pixel is not the sth fault category s is 0; p is Represents the probability that the i-th predicted pixel point belongs to the s-th fault category; the initial detection model is updated according to the back propagation algorithm until the first loss value is less than or equal to the preset termination threshold, and the updating of the initial detection model is stopped to obtain the fault detection model trained to a convergent state.
[0009] In some embodiments, the fault information labeling method also includes the step of training the generative pre-trained model, and the step of training the generative pre-trained model includes: receiving historical fault images of the equipment to be detected and descriptive information corresponding to the historical fault images, wherein the descriptive information includes fault category, fault level, and fault location; constructing training prompt data according to the historical fault images, the descriptive information and the pre-stored prompt template; inputting the training prompt data into the pre-constructed initial generation model to obtain multiple predicted description information corresponding to the labeled fault image; determining the reward and punishment scores of the initial generation model according to the multiple predicted description information and the description information; updating the training prompt data according to the reward and punishment scores and the multiple predicted description information; inputting the updated training prompt data into the initial generation model multiple times to obtain a generative pre-trained model trained to a convergent state.
[0010] In some embodiments, determining the reward or punishment score of the initial generation model based on the multiple prediction description information and the description information includes: encoding the multiple prediction description information to obtain a first code corresponding to each prediction description information; encoding the description information to obtain a second code; determining the similarity between each prediction description information and the description information based on the first code and the second code; and normalizing the similarity to obtain a reward or punishment score corresponding to each prediction description information.
[0011] In some embodiments, determining the similarity between each predicted description information and the description information includes: inputting the predicted description information and the description information into a pre-trained twin network to obtain a first feature vector of the predicted description information and a second feature vector corresponding to the description information; wherein the twin network includes a first encoding unit and a second encoding unit; determining the cosine similarity between the first feature vector and the second feature vector as the similarity; and a method for training the twin network, including: inputting first training data into an initial first encoding unit in an initial twin network to obtain a first encoding vector; inputting second training data into an initial second encoding unit in an initial twin network to obtain a second encoding vector; determining the predicted similarity between the first encoding vector and the second encoding vector; determining the difference between the predicted similarity and the pre-stored similarity; updating the initial twin network according to a back-propagation algorithm until the difference is less than or equal to a pre-stored termination threshold, stopping updating the initial twin network, and obtaining a twin network trained to a convergence state.
[0012] In some embodiments, labeling the fault image according to the prediction description information includes: encoding the fault type corresponding to the fault image to obtain a fault code; using the fault code as a key and the prediction description information corresponding to the fault type as a value to obtain a labeling key-value pair; storing the labeling key-value pair and the fault image to obtain the labeled fault image.
[0013] An embodiment of the present application also provides a fault information labeling device, which includes: a receiving module, used to receive a monitoring video of a device to be detected in real time, wherein the monitoring video includes multiple video frames; a determination module, used to determine a fault image containing a fault area from the multiple video frames; the determination module is also used to construct prompt data based on the fault image and a pre-stored prompt template; the determination module is also used to input the prompt data into a pre-trained generative pre-trained model to obtain predictive description information corresponding to the fault image; the determination module is also used to label the fault area in the fault image according to the predictive description information.
[0014] An embodiment of the present application further provides an electronic device, comprising: a memory storing at least one instruction; and a processor executing the instruction stored in the memory to implement the fault information labeling method.
[0015] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the fault information labeling method.
[0016] It can be seen from the above technical scheme that the embodiment of the present application obtains multiple video frames in the monitoring video by receiving the monitoring video of the equipment to be detected in real time. And determine the fault image containing the fault area from the multiple video frames. Then construct the prompt data according to the fault image and the pre-stored prompt template, so that the information in the fault image can be formatted, ensuring that the generative pre-trained model can accurately identify the intention to describe the fault in the fault image. Then input the prompt data into the pre-trained generative pre-trained model to obtain the predicted description information corresponding to the fault image, and finally mark the fault area in the fault image according to the predicted description information. In this way, the fault information in the fault image is described by the generative pre-trained model, and the predicted description information that conforms to the natural language logic can be generated, which makes it easier for the operation and maintenance personnel to understand the fault information, thereby improving the efficiency of equipment operation and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is an application scenario diagram of a fault information labeling method provided in one embodiment of the present application.
[0018] Figure 2 This is a flowchart of a fault information labeling method provided in one embodiment of the present application.
[0019] Figure 3 It is a functional module diagram of a fault information labeling device provided in one embodiment of the present application.
[0020] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to more clearly understand the purpose, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other. In the following description, many specific details are set forth to facilitate a full understanding of the present application, and the embodiments described are only a part of the embodiments of the present application, rather than all of the embodiments.
[0022] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used herein in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0024] The embodiment of the present application provides a fault information labeling method, which can be applied to one or more electronic devices. The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device, etc.
[0025] An electronic device can be any electronic product that can interact with customers, such as personal computers, tablet computers, smart phones, personal digital assistants (PDAs), game consoles, Internet Protocol Television (IPTV), smart wearable devices, etc.
[0026] The electronic device may also include a network device and / or a client device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.
[0027] The networks where electronic devices are located include but are not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.
[0028] like Figure 1As shown, a fault information labeling method provided by the present application can be applied to an electronic device 100, and the electronic device 100 is connected to a database 200 in communication. The electronic device 100 is used to receive a monitoring video of a device to be detected from the database 200 in real time, wherein the monitoring video includes a plurality of video frames; determine a fault image containing a fault area from the plurality of video frames; construct prompt data according to the fault image and a pre-stored prompt template; input the prompt data into a pre-trained generative pre-trained model to obtain prediction description information corresponding to the fault image; and label the fault area in the fault image according to the prediction description information.
[0029] like Figure 2 FIG. 1 is a flowchart of a fault information labeling method provided in an embodiment of the present application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. A fault information labeling method provided in an embodiment of the present application includes the following steps.
[0030] S20, receiving a monitoring video of the device to be detected in real time, wherein the monitoring video includes a plurality of video frames.
[0031] In one embodiment of the present application, in order to obtain the operating status of the device to be detected in real time, the electronic device can receive the monitoring video of the device to be detected in real time, and determine whether the parts of the device to be detected are defective or malfunctioning by analyzing multiple video frames in the monitoring video. The monitoring video can be video data captured in real time by a camera device and transmitted to the electronic device.
[0032] S21, determining a fault image including a fault area from the multiple video frames.
[0033] In one embodiment of the present application, the monitoring video includes multiple video frames. In order to improve the accuracy of identifying the fault area of the device to be detected, a key frame can be determined from the multiple video frames, and a fault image containing the fault area can be determined from the key frame. Specifically, determining the fault image containing the fault area from the multiple video frames includes: constructing a key frame based on the multiple video frames; inputting the key frame into the fault detection model to obtain a fault image containing the fault area.
[0034] In one embodiment of the present application, the difference between every two adjacent video frames can be determined, and a key frame can be determined from multiple video frames according to the difference. Specifically, determining the key frame includes: determining the difference between every two adjacent video frames; determining a difference threshold according to the difference, including: determining a mean and a standard deviation, and determining the difference between the mean and three times the standard deviation as a threshold; when the difference between any two adjacent video frames is less than the difference threshold, determining the any two adjacent video frames as candidate frames; and obtaining a key frame by fusing the candidate frames.
[0035] The difference between each two adjacent video frames is used to characterize the degree of difference between the two previous and next video frames in the monitoring video of the device to be detected. When the difference is greater, the content represented by the two adjacent video frames is more different; when the difference is smaller, the content represented by the two adjacent video frames is more similar. Specifically, the method for determining the difference can be any algorithm for determining the difference between images, for example, it can be mean square error, structural similarity index, peak signal-to-noise ratio, histogram comparison, etc.
[0036] In one embodiment of the present application, the difference threshold is used to characterize the standard value in the difference. When the difference between any two adjacent video frames is less than the difference threshold, it indicates that the difference between the two adjacent video frames is small, and the two video frames are relatively similar. It can be determined that the content of the two adjacent video frames in the monitoring video indicates that the device to be detected is not moving at a high speed, so the two adjacent video frames can be determined as candidate frames, and the key frame can be obtained by fusing the candidate frames later.
[0037] In some embodiments of the present application, the method of fusing candidate frames to obtain key frames can be a generative adversarial network, an Alpha fusion algorithm, a pyramid fusion algorithm, a Poisson fusion algorithm, etc., which is not limited in the present application.
[0038] In one embodiment of the present application, in order to improve the accuracy of fault detection of the device to be detected based on the key frame, the fault detection model can be pre-trained. Specifically, the step of training the fault detection model includes: inputting a training image into a pre-built initial detection model to obtain predicted fault information corresponding to the training image; wherein the predicted fault information at least includes predicted pixel point coordinates and the probability that the predicted pixel point belongs to a preset fault category; calculating the first loss value of the initial detection model according to the predicted fault and the pre-stored fault label, wherein the pre-stored fault label includes the label pixel point coordinates and the fault category of the label pixel point; wherein the calculation method of the first loss value satisfies the following relationship: , where Loss represents the first loss value; i represents the index of the predicted pixel point; m represents the number of predicted pixels; j represents the index of the label pixel point; n represents the number of label pixels; C i represents the coordinates of the i-th predicted pixel; D j Represents the coordinates of the jth label pixel; represents the Euclidean distance between the coordinates of the i-th predicted pixel and the coordinates of the j-th labeled pixel; s represents the index of the fault category; r represents the number of fault categories; y s represents the symbol function. When the fault category of the label pixel is the sth fault category, y s is 1, when the fault category of the label pixel is not the sth fault categorys is 0; p is Represents the probability that the i-th predicted pixel point belongs to the s-th fault category; the initial detection model is updated according to the back propagation algorithm until the first loss value is less than or equal to the preset termination threshold, and the updating of the initial detection model is stopped to obtain the fault detection model trained to a convergent state.
[0039] Among them, the first loss value is used to characterize the difference between the fault pixel predicted by the initial detection model and the corresponding label data. The higher the first loss value, the greater the difference between the predicted fault pixel and the corresponding label data, and the worse the performance of the initial detection model. Therefore, the back propagation algorithm can be used to update the initial detection model. When the first loss value is less than or equal to the preset termination threshold, it indicates that the difference between the fault pixel predicted by the initial detection model and the corresponding label data is small, and the initial detection model can be stopped from being updated to obtain a fault detection model trained to a converged state.
[0040] S22, constructing prompt data according to the fault image and a pre-stored prompt template.
[0041] In one embodiment of the present application, a fault image corresponds to fault information, and the fault image contains at least one fault area, and the fault area includes multiple fault pixels. Specifically, the fault information may be data in a key-value pair format, which is used to indicate that each fault pixel corresponds to a fault category and the confidence that the pixel belongs to the fault category. In order to improve the accuracy of subsequent annotation of the fault area, prompt data may be constructed in advance based on the fault image and the prompt template. Among them, the prompt template is used to format the fault image, and the prompt data is used to characterize the fault image after formatting. Specifically, the prompt data includes background prompts, task prompts, example prompts, etc. Among them, the background prompt is used to characterize the functional description of the prompt data; the task prompt is used to characterize the need to annotate the fault image; and the example prompt is used to characterize a specific example of generating descriptive information based on the prompt data. Exemplarily, the fault information may be {[(1, 2), 90%], [(3, 4), 60%], [(5, 6), 70%]}, which is used to characterize that the probability that the pixel with coordinates (1, 2) in the fault image is a faulty pixel is 90%, the probability that the pixel with coordinates (3, 4) is a faulty pixel is 60%, and the probability that the pixel with coordinates (5, 6) is a faulty pixel is 70%.
[0042] Exemplarily, the content of the prompt template may be: "Background prompt: You are an intelligent assistant with image annotation function; Task prompt: Please generate corresponding annotation information based on the information of the following fault image. The length of each annotation information shall not exceed 100 bytes. The part of speech of the annotation information shall be adjective or adjective + noun, and the annotation information shall be arranged in a row without punctuation marks; Fault information:; Example prompt:".
[0043] Exemplarily, after filling in the fault image into the "fault information" in the prompt template, and filling in the corresponding fault description information into the example prompt, the content of the training prompt data includes: "Background prompt: You are an intelligent assistant with image annotation function; Task prompt: Please generate corresponding annotation information based on the following fault image. The length of each annotation information shall not exceed 100 bytes. The part of speech of the annotation information is adjective or adjective + noun, and the annotation information is arranged in a row without punctuation marks; Fault information: {[(1, 2), 90%], [(3, 4), 60%], [(5, 6), 70%]}; Example prompt: The probability that the pixel with coordinates (1, 2) in the fault image is a fault pixel is 90%, the probability that the pixel with coordinates (3, 4) is a fault is 60%, and the probability that the pixel with coordinates (5, 6) is a fault is 70%".
[0044] S23, inputting the prompt data into a pre-trained generative pre-training model to obtain prediction description information corresponding to the fault image.
[0045] In one embodiment of the present application, in order to explain the fault area in the fault image, prompt data can be input into a pre-trained generative pre-trained model to obtain predictive description information corresponding to the fault area in the fault image. The predictive description information is used to characterize the detailed description corresponding to the fault area in the fault image. Exemplarily, the predictive description information may be "The fault type in the fault image belongs to "corrosion fault". Among them, the probability that the pixel with coordinates (1, 2) is a fault pixel is 90%, the probability that the pixel with coordinates (3, 4) is a fault is 60%, and the probability that the pixel with coordinates (5, 6) is a fault is 70%".
[0046] In another embodiment of the present application, in order to improve the accuracy of obtaining predictive description information, the generative pre-trained model can be pre-trained to a convergent state, thereby improving the performance of the generative pre-trained model, and further improving the accuracy of obtaining predictive description information. Specifically, the steps of training the generative pre-trained model include: constructing training prompt data based on historical fault images and corresponding description information; inputting the training prompt data into the pre-constructed initial generation model to obtain multiple predictive description information corresponding to the historical fault images; determining the reward and punishment scores of the initial generation model based on the multiple predictive description information and the description information; updating the training prompt data based on the reward and punishment scores and the multiple predictive description information; inputting the updated training prompt data into the initial generation model multiple times to obtain a generative pre-trained model trained to a convergent state. Among them, the initial generation model can be an existing model structure such as a generative pre-trained model, an LLaMA model, etc., and the present application does not limit this.
[0047] In one embodiment of the present application, since the content of the description information corresponding to different fault types is quite different, in order to improve the generalization ability of the initial generation model and the accuracy of the generated description information, the reward and punishment score of the initial generation model can be determined based on the generated prediction description information and the description information corresponding to the historical fault image, so that the initial generation model can be continuously updated according to the quantified reward and punishment score, thereby improving the generalization ability of the initial generation model. Specifically, determining the reward and punishment score of the initial generation type based on multiple prediction description information and the description information corresponding to the training image includes: encoding the multiple prediction description information to obtain a first code corresponding to each prediction description information; encoding the description information to obtain a second code; determining the similarity between each prediction description information and the description information based on the first code and the second code; normalizing the similarity to obtain the reward and punishment score corresponding to each prediction description information.
[0048] In one embodiment of the present application, determining the similarity between each prediction description information and the description information includes: inputting any prediction description information and the description information into a pre-trained twin network to obtain a first feature vector of any prediction description information and a second feature vector corresponding to the description information; wherein the twin network includes a first encoding unit and a second encoding unit; and determining the cosine similarity between the first feature vector and the second feature vector as the similarity.
[0049] In one embodiment of the present application, in order to determine the accuracy of improving the calculation of similarity, the twin network can also be pre-trained to a convergence state, thereby improving the accuracy of determining similarity. Specifically, the method of training the twin network includes: inputting the first training data to the initial first coding unit in the initial twin network to obtain a first coding vector; inputting the second training data to the initial second coding unit in the initial twin network to obtain a second coding vector; determining the predicted similarity between the first coding vector and the second coding vector; determining the difference between the predicted similarity and the pre-stored similarity; updating the initial twin network according to the back-propagation algorithm until the difference is less than or equal to the pre-stored termination threshold, stopping updating the initial twin network, and obtaining a twin network trained to a convergence state.
[0050] Among them, the smaller the difference between the predicted similarity and the pre-stored similarity, the better the performance of the initial twin network, and the more accurate the similarity between the first eigenvector and the second eigenvector determined by the twin network.
[0051] S24: Mark the fault area in the fault image according to the prediction description information.
[0052] In one embodiment of the present application, the prediction description information may be data in text format or data in string format, and the present application does not limit this. In order to facilitate querying the prediction description information corresponding to the fault image, the prediction description information may be stored in the form of a key-value pair. Specifically, labeling the fault image according to the prediction description information includes: encoding the fault type corresponding to the fault image to obtain a fault code; using the fault code as a key and the prediction description information corresponding to the fault type as a value to obtain a labeling key-value pair; storing the labeling key-value pair and the fault image to obtain the labeled fault image.
[0053] It can be seen from the above technical scheme that the embodiment of the present application obtains multiple video frames in the monitoring video by receiving the monitoring video of the equipment to be detected in real time. And determine the fault image containing the fault area from the multiple video frames. Then construct the prompt data according to the fault image and the pre-stored prompt template, so that the information in the fault image can be formatted, ensuring that the generative pre-trained model can accurately identify the intention to describe the fault in the fault image. Then input the prompt data into the pre-trained generative pre-trained model to obtain the predicted description information corresponding to the fault image, and finally mark the fault area in the fault image according to the predicted description information. In this way, the fault information in the fault image is described by the generative pre-trained model, and the predicted description information that conforms to the natural language logic can be generated, which makes it easier for the operation and maintenance personnel to understand the fault information, thereby improving the efficiency of equipment operation and maintenance.
[0054] See also Figure 3 , Figure 3 3 is a functional module diagram of a fault information labeling device provided in an embodiment of the present application. A fault information labeling device 31 includes a receiving module 310 and a determination module 311. The module / unit referred to in the present application refers to a series of computer-readable instruction segments that can be executed by the processor 13 and can complete a fixed function, which is stored in the memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.
[0055] A receiving module 310, configured to receive a monitoring video of a device to be detected in real time, wherein the monitoring video includes a plurality of video frames;
[0056] A determination module 311 is used to determine a fault image including a fault area from the multiple video frames;
[0057] The determination module 311 is further used to construct prompt data according to the fault image and a pre-stored prompt template;
[0058] The determination module 311 is further used to input the prompt data into a pre-trained generative pre-training model to obtain prediction description information corresponding to the fault image;
[0059] The determining module 311 is further configured to mark the fault area in the fault image according to the prediction description information.
[0060] See also Figure 4 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 100 includes a memory 12 and a processor 13. The memory 12 is used to store computer-readable instructions, and the processor 13 is used to execute the computer-readable instructions stored in the memory to implement a fault information labeling method described in any of the above embodiments.
[0061] In an embodiment of the present application, the electronic device 100 further includes a bus, and a computer program stored in the memory 12 and executable on the processor 13, such as a fault information marking program.
[0062] Figure 4 Only the electronic device 100 having the memory 12 and the processor 13 is shown, and those skilled in the art can understand that Figure 4 The structure shown does not constitute a limitation on the electronic device 100 , and the electronic device 100 may include fewer or more components than shown in the figure, or combine some components, or arrange the components differently.
[0063] Combination Figure 2The memory 12 in the electronic device 100 stores a plurality of computer-readable instructions to implement a fault information labeling method, and the processor 13 can execute the plurality of instructions to implement: receiving a monitoring video of the device to be detected in real time, the monitoring video comprising a plurality of video frames; determining a fault image containing a fault area from the plurality of video frames; constructing prompt data according to the fault image and a pre-stored prompt template; inputting the prompt data into a pre-trained generative pre-trained model to obtain prediction description information corresponding to the fault image; and labeling the fault area in the fault image according to the prediction description information.
[0064] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 2 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0065] Those skilled in the art will appreciate that the schematic diagram is merely an example of the electronic device 100 and does not constitute a limitation on the electronic device 100. The electronic device 100 may be a bus-type structure or a star-type structure. The electronic device 100 may also include more or less other hardware or software than shown in the diagram, or a different arrangement of components. For example, the electronic device 100 may also include input and output devices, network access devices, etc.
[0066] It should be noted that the electronic device 100 is only an example, and other existing or future electronic products that are suitable for the present application should also be included in the protection scope of the present application and included here by reference.
[0067] The memory 12 includes at least one type of readable storage medium, which may be non-volatile or volatile. The readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 12 may be an internal storage unit of the electronic device 100, such as a mobile hard disk of the electronic device 100. In other embodiments, the memory 12 may also be an external storage device of the electronic device 100, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the electronic device 100. The memory 12 may not only be used to store application software and various types of data installed in the electronic device 100, such as a code of a fault information labeling program, etc., but may also be used to temporarily store data that has been output or is to be output.
[0068] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 100, and uses various interfaces and lines to connect various components of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing programs or modules stored in the memory 12 (for example, executing a fault information marking program, etc.), and calling data stored in the memory 12.
[0069] The processor 13 executes the operating system of the electronic device 100 and various installed applications. The processor 13 executes the applications to implement the steps in each of the above-mentioned embodiments of the fault information marking method, for example Figure 2 Steps shown.
[0070] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 100. For example, the computer program may be divided into a receiving unit 310 and a determining unit 311.
[0071] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute a part of a fault information labeling method described in each embodiment of the present application.
[0072] If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware devices to complete through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented.
[0073] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory and other memory, etc.
[0074] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0075] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. Figure 4 Only one arrow is used in the figure, but it does not mean that there is only one bus or one type of bus. The bus is configured to realize the connection and communication between the memory 12 and at least one processor 13, etc.
[0076] An embodiment of the present application also provides a computer-readable storage medium (not shown), in which computer-readable storage medium is stored computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement a fault information labeling method described in any of the above embodiments.
[0077] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0078] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0079] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0080] In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the specification can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A fault information marking method, applied to electronic equipment, It is characterized in that The method comprises: Receiving a monitoring video of the device to be detected in real time, wherein the monitoring video includes a plurality of video frames; Determining a fault image containing a fault area from the multiple video frames includes: constructing a key frame based on the multiple video frames; inputting the key frame to a fault detection model to obtain the fault image containing the fault area; wherein the step of training the fault detection model includes: inputting a training image to a pre-constructed initial detection model to obtain predicted fault information corresponding to the training image; wherein the predicted fault information at least includes predicted pixel point coordinates and the probability that the predicted pixel point belongs to a preset fault category; calculating a first loss value of the initial detection model according to the predicted fault and a pre-stored fault label, wherein the pre-stored fault label includes label pixel point coordinates and the fault category of the label pixel point; wherein the calculation method of the first loss value satisfies the following relationship: , Wherein, Loss represents the first loss value; i represents the index of the predicted pixel point; m represents the number of the predicted pixel points; j represents the index of the label pixel point; n represents the number of the label pixel points; C i represents the coordinates of the i-th predicted pixel; D j Represents the coordinates of the jth label pixel; represents the Euclidean distance between the coordinates of the i-th predicted pixel and the coordinates of the j-th labeled pixel; s represents the index of the fault category; r represents the number of fault categories; y s represents the symbol function. When the fault category of the label pixel is the sth fault category, y s is 1, when the fault category of the label pixel is not the sth fault category s is 0; p is represents the probability that the i-th predicted pixel point belongs to the s-th fault category; updating the initial detection model according to the back propagation algorithm until the first loss value is less than or equal to a preset termination threshold, stopping updating the initial detection model, and obtaining the fault detection model trained to a converged state; Constructing prompt data according to the fault image and a pre-stored prompt template; Input the prompt data into a pre-trained generative pre-training model to obtain prediction description information corresponding to the fault image, wherein the prediction description information is used to characterize the detailed description corresponding to the fault area in the fault image; The fault area in the fault image is marked according to the prediction description information.
2. A fault information marking method according to claim 1, It is characterized in that Determining the key frames among the plurality of video frames comprises: Determine the difference between every two adjacent video frames; Determining a difference threshold according to the difference includes: determining a mean and a standard deviation of the difference, and determining a difference between the mean and three times the standard deviation as the difference threshold; When the difference between any two adjacent video frames is less than the difference threshold, determining the any two adjacent video frames as candidate frames; By fusing the candidate frames, a key frame is obtained.
3. A fault information marking method according to claim 1, It is characterized in that The fault information labeling method further includes a step of training the generative pre-training model, wherein the step of training the generative pre-training model includes: Receive a historical fault image of the device to be detected and description information corresponding to the historical fault image, wherein the description information includes a fault type, a fault level, and a fault location; Constructing training prompt data according to the historical fault image, the description information and the pre-stored prompt template; Inputting the training prompt data into a pre-built initial generation model to obtain a plurality of prediction description information corresponding to the annotated fault image; Determining a reward or punishment score of the initial generation model according to the plurality of prediction description information and the description information; Update the training prompt data according to the reward and punishment scores and the plurality of prediction description information; The updated training prompt data is input into the initial generation model multiple times to obtain a generative pre-training model trained to a convergent state.
4. A fault information marking method as claimed in claim 3, It is characterized in that The step of determining the reward or punishment score of the initial generation model according to the plurality of prediction description information and the description information comprises: Encoding the plurality of prediction description information to obtain a first code corresponding to each prediction description information; Encoding the description information to obtain a second code; Determine the similarity between each predicted description information and the description information according to the first code and the second code; The similarity is normalized to obtain the reward or punishment score corresponding to each prediction description information.
5. A fault information marking method as claimed in claim 4, It is characterized in that Determining the similarity between each prediction description information and the description information includes: Input the prediction description information and the description information into a pre-trained twin network to obtain a first feature vector of the prediction description information and a second feature vector corresponding to the description information; wherein the twin network includes a first encoding unit and a second encoding unit; determining a cosine similarity between the first feature vector and the second feature vector as the similarity; and The method for training the twin network comprises: Inputting the first training data into the initial first encoding unit in the initial twin network to obtain a first encoding vector; Input the second training data into the initial second encoding unit in the initial twin network to obtain a second encoding vector; Determining a predicted similarity between the first encoding vector and the second encoding vector; Determining a difference between the predicted similarity and the pre-stored similarity; The initial twin network is updated according to the back propagation algorithm until the difference is less than or equal to the pre-stored termination threshold, and the updating of the initial twin network is stopped to obtain a twin network trained to a converged state.
6. A fault information marking method according to claim 1, It is characterized in that Labeling the fault image according to the prediction description information includes: Encoding the fault type corresponding to the fault image to obtain a fault code; Using the fault code as a key and the prediction description information corresponding to the fault type as a value, a label key-value pair is obtained; The annotated key-value pair and the fault image are stored to obtain the annotated fault image.
7. A fault information marking device, It is characterized in that The device comprises a module for implementing a fault information labeling method according to any one of claims 1 to 6, and the device comprises: A receiving module, used for receiving a monitoring video of a device to be detected in real time, wherein the monitoring video includes a plurality of video frames; A determination module, configured to determine a fault image including a fault area from the plurality of video frames; The determination module is further used to construct prompt data according to the fault image and a pre-stored prompt template; The determination module is further used to input the prompt data into a pre-trained generative pre-training model to obtain prediction description information corresponding to the fault image; The determination module is further configured to mark the fault area in the fault image according to the prediction description information.
8. An electronic device, It is characterized in that The electronic device includes a processor and a memory, and the processor is used to implement a fault information labeling method as described in any one of claims 1 to 6 when executing a computer program stored in the memory.
