Training method, identification method and device of equipment sleeve pollution identification model
By using the initial filth recognition model to extract and screen the target bands and perform iterative training based on these bands, the problem of excessively high spectral image data dimensions is solved, and the training efficiency and accuracy of the filth recognition model are improved.
Patent Information
- Application Number
- CN202411913362.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-08
AI Technical Summary
In the application of spectral image technology, due to the increase in spectral bands, the redundant information in the image data increases, resulting in excessive data dimensions and increased processing complexity, increasing the cost of data storage and transmission, and may lead to inefficiency and accuracy of steps such as feature extraction and classification recognition.
A training method for filth recognition model is provided. By obtaining multiple current spectral images of different filth areas on the device casing and their corresponding filth levels, the initial filth recognition model is used to extract the original spectral data, and the target band is determined based on the correlation between adjacent bands, reducing the data dimension of model training, and retaining effective information to the greatest extent. Then, by making filth predictions on the target band and iteratively trained based on the difference between the prediction level and the actual level until the end condition is reached, a trained filth recognition model is obtained.
By reducing the data dimension and reducing redundant information, the efficiency and accuracy of model training are improved, the accuracy and reliability of filth recognition are ensured, and the difficulty of data processing is reduced.
Smart Images

Figure CN119785146A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of spectral image processing, and in particular to a training method, an identification method, a device, a computer device, a computer-readable storage medium and a computer program product for an equipment casing contamination identification model. Background Art
[0002] As a key component in the power grid, the performance of the insulator bushing directly affects the stability and safety of the power system. During the long-term use of the insulator bushing, dirt will adhere to the surface of the bushing. These dirt will not only reduce the insulation performance of the insulator, but also may cause local discharge and overheating in a humid environment, causing the insulation surface to be carbonized to form a conductive path, and then generate an arc, that is, the "creeping" phenomenon. If it is not cleaned in time, this local discharge may gradually develop and eventually lead to insulation failure and grid failure. In order to prevent grid failures caused by the degradation of external insulation performance, it is usually necessary to develop a reasonable cleaning and replacement plan by detecting the defect state of the external insulation surface.
[0003] As an advanced non-destructive testing technology, spectral imaging technology can accurately reflect the different evolution stages and characteristics of casing defects. Spectral imaging has a large number of spectral bands, which is helpful for fine classification and identification of insulation status. Spectral imaging captures the reflection, transmission or emission characteristics of objects in different spectral bands to generate image data containing rich feature information. By extracting and analyzing this feature information, the insulation status of the casing can be finely classified and identified, thereby achieving early warning and precise positioning of casing defects.
[0004] However, in the application of spectral imaging technology, with the increase of spectral bands, the redundant information in the image data also increases, resulting in excessively high data dimensions and a sharp increase in processing complexity. This not only increases the cost of data storage and transmission, but may also lead to inefficiency and reduced accuracy in subsequent feature extraction, classification and recognition steps. Summary of the invention
[0005] Based on this, it is necessary to provide a training method, device, computer equipment, computer-readable storage medium and computer program product for a contamination identification model that can improve the efficiency and accuracy of model training in order to address the above technical problems.
[0006] In a first aspect, the present application provides a method for training a contamination recognition model, the method comprising:
[0007] Acquire a training data set, the training data set including a plurality of current spectral images of different contamination areas on a device casing and contamination levels corresponding to the current spectral images;
[0008] Inputting the current spectrum image into a pre-built initial pollution recognition model to perform spectrum extraction to obtain original spectrum data;
[0009] Determining the target band based on the correlation between adjacent bands in each of the original spectral data by using the initial contamination identification model;
[0010] Performing pollution prediction on the target band by using the initial pollution recognition model, and outputting the pollution prediction level corresponding to the current spectral image;
[0011] Based on the data difference between the contamination prediction level and the contamination level, the initial contamination recognition model is iteratively trained until an end condition is reached to obtain a trained contamination recognition model; the trained contamination recognition model is used to perform contamination prediction on an input target spectral image to obtain a contamination level corresponding to the target spectral image.
[0012] In one embodiment, the step of inputting the current spectral image into a pre-built initial pollution identification model to perform spectral extraction to obtain original spectral data includes:
[0013] Inputting the current spectral image into a pre-built initial pollution recognition model;
[0014] Performing black-and-white correction on each current spectral image by using the initial contamination recognition model to obtain a whiteboard correction image and a blackboard correction image corresponding to each current spectral image, and obtaining a corrected current spectral image according to the whiteboard correction image and the blackboard correction image;
[0015] The corrected current spectral images are sequentially subjected to edge detection, pooling processing and region of interest extraction, and original spectral data of each contaminated region is determined based on average spectral data in the region of interest.
[0016] In one embodiment, the determining the target band based on the correlation between adjacent bands in each of the original spectral data by using the initial contamination identification model includes:
[0017] Baseline correction is performed on each original spectral data to obtain corrected spectral data corresponding to each original spectral data, and a spectral characteristic curve is constructed based on the corrected spectral data; the spectral characteristic curve has a plurality of bands corresponding to the spectral data obtained by dividing according to a preset wavelength interval;
[0018] Based on the correlation between adjacent bands in the spectral characteristic curve, characteristic bands are extracted according to a preset number, and bands that meet preset conditions are determined from the characteristic bands as target bands.
[0019] In one embodiment, the baseline correction is performed on each original spectral data to obtain the corrected spectral data corresponding to each original spectral data, including:
[0020] Determine the average values of each original spectral data respectively, and obtain the standard spectral data of each original spectral data according to each average value;
[0021] Determine an offset and a translation of the original spectrum data relative to the standard spectrum data;
[0022] Baseline correction is performed on the original spectral data based on the offset and the translation to obtain corrected spectral data.
[0023] In one embodiment, extracting characteristic bands according to a preset number based on the correlation between adjacent bands in the spectral characteristic curve, and determining a band that meets a preset condition as a target band from the characteristic bands includes:
[0024] Divide each band in each spectral characteristic curve into a modeling set and a verification set according to a preset ratio;
[0025] Determine a current modeling set, select a band from the current modeling set to be determined as a current modeling sample, and use the current modeling sample to initialize a current operation vector of a continuous projection algorithm;
[0026] adding the current operation vector to a selected sample set; the selected sample set is determined based on historically selected and processed spectral data;
[0027] For each modeling set, respectively determine the current projection vector of each band in the unselected sample set of the modeling set on the selected sample set, and use the current projection vector that meets the conditions among the current projection vectors as the new current operation vector, return to execute the step of adding the current operation vector to the selected sample set until the end condition is met, and obtain a feature band; the unselected sample set is the complement of the selected sample set on the corresponding modeling set;
[0028] When the number of the characteristic bands does not reach the preset number, a new modeling set is determined as the current modeling set, and the step of selecting a band from the current modeling set as the current modeling sample and initializing the current operation vector of the continuous projection algorithm using the current modeling sample is returned to be executed until the preset number of characteristic bands is obtained;
[0029] A band that meets the preset condition is determined based on the verification set, the current projection vector that meets the condition, and the characteristic band, and the band that meets the preset condition is determined as a target band.
[0030] In one embodiment, the method further comprises:
[0031] Based on the reflectivity level of the corrected spectral data, the wavebands corresponding to each corrected spectral data are clustered to obtain a plurality of clustered data sets with different reflectivity levels; the reflectivity is positively correlated with the pollution level;
[0032] The method of dividing each band in each spectral characteristic curve into a modeling set and a verification set according to a preset ratio includes:
[0033] Each clustering data set is divided according to a preset ratio to obtain a modeling set and a validation set for each clustering data set.
[0034] In a second aspect, the present application also provides a training device for a contamination recognition model, the device comprising:
[0035] A data acquisition module, used to acquire a training data set, wherein the training data set includes a plurality of current spectral images of different contamination areas on the equipment casing and contamination levels corresponding to the current spectral images;
[0036] A spectrum extraction module, used for inputting the current spectrum image into a pre-built initial pollution recognition model to perform spectrum extraction and obtain original spectrum data;
[0037] A band selection module, used for determining a target band based on the correlation between adjacent bands in each of the original spectral data by using the initial contamination identification model;
[0038] A contamination prediction module, used to perform contamination prediction on the target band through the initial contamination recognition model, and output a contamination prediction level corresponding to the current spectral image;
[0039] An iterative training module is used to iteratively train the initial contamination recognition model based on the data difference between the contamination prediction level and the contamination level until an end condition is reached to obtain a trained contamination recognition model; the trained contamination recognition model is used to perform contamination prediction on an input target spectral image to obtain a contamination level corresponding to the target spectral image.
[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the training method of the contamination recognition model as described above when executing the computer program.
[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for training a contamination recognition model as described above.
[0042] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the training method of the contamination recognition model as described above.
[0043] The training method, device, computer device, computer-readable storage medium and computer program product of the equipment casing contamination recognition model obtain multiple current spectral images of different contamination areas on the equipment casing and the contamination levels corresponding to the current spectral images, input the current spectral images into a pre-constructed initial contamination recognition model, use the initial contamination recognition model to extract the original spectral data in the current spectral image, obtain the original spectral data, and determine the target band based on the correlation between adjacent bands in each original spectral data through the initial contamination recognition model to reduce the data dimension of subsequent model training, and the target band retains the effective information in the original spectral data to the maximum extent, which is conducive to improving the training. The quality of training data is improved; subsequently, the pollution prediction of the target band is performed through the initial pollution recognition model, and the pollution prediction level corresponding to the current spectral image is output; based on the data difference between the pollution prediction level and the pollution level, the initial pollution recognition model is iteratively trained until the end condition is reached, and a trained pollution recognition model is obtained to perform pollution prediction on the target spectral image and obtain the pollution level of the target spectral image; the target band used for model training contains a large amount of effective information and the remaining band after removing redundant information, so that the data sample size can be greatly reduced, the difficulty of data processing for the initial pollution recognition model can be reduced, and the training efficiency of the model can be improved while ensuring the accuracy of model training.
[0044] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for equipment casing contamination identification that can improve the accuracy of contamination identification in order to solve the above technical problems.
[0045] In a sixth aspect, the present application also provides a method for identifying contamination of an equipment casing, the method comprising:
[0046] Acquire a target spectral image of the surface of the casing of the device to be identified;
[0047] Inputting the target spectral image into a pollution recognition model; the pollution recognition model is trained based on the method described above;
[0048] The pollution level corresponding to the target spectral image is output based on the pollution identification model to obtain the pollution identification result of the surface of the equipment casing.
[0049] In one embodiment, the method further comprises:
[0050] The contamination identification results are visualized using a pseudo-color map.
[0051] In a seventh aspect, the present application further provides a device for identifying contamination of an equipment casing, the device comprising:
[0052] An image acquisition module, used to acquire a target spectral image of the surface of the device casing to be identified;
[0053] An image input module, used for inputting the target spectrum image into a pollution recognition model; the pollution recognition model is obtained by training based on the training method as described above or by training through the training device as described above;
[0054] The contamination recognition module is used to output the contamination level corresponding to the target spectral image based on the contamination recognition model to obtain the contamination recognition result of the surface of the equipment casing.
[0055] In an eighth aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the device casing contamination identification method as described above when executing the computer program.
[0056] In a ninth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the device casing contamination identification method as described above are implemented.
[0057] In a tenth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the device casing contamination identification method as described above.
[0058] The above-mentioned equipment casing contamination identification method, device, computer equipment, computer-readable storage medium and computer program product obtain the target spectral image of the surface of the equipment casing to be identified, and input the target spectral image into the contamination identification model to predict the contamination level, thereby obtaining the contamination identification result of the equipment casing surface. Through the contamination prediction, the potential contamination problems of various electrical equipment in the power system can be discovered in advance, and corresponding measures can be taken to prevent and deal with them, thereby avoiding or reducing the occurrence of flashover accidents and ensuring the safe operation of electrical equipment in the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0060] Figure 1 A diagram of an application environment for a method for training a contamination recognition model and a method for identifying contamination in an equipment casing in one embodiment;
[0061] Figure 2 A flowchart of a method for training a contamination recognition model in one embodiment;
[0062] Figure 3 A schematic diagram of a process for obtaining raw spectral data in one embodiment;
[0063] Figure 4 A schematic diagram of a process for extracting a target band in one embodiment;
[0064] Figure 5 A schematic diagram of a target band determined in one embodiment;
[0065] Figure 6 A schematic diagram of a process of identifying equipment casing contamination in one embodiment;
[0066] Figure 7 is a structural block diagram of a training device for a contamination recognition model in one embodiment;
[0067] Figure 8 It is a structural block diagram of a device for identifying contamination of equipment casing in one embodiment;
[0068] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0069] 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.
[0070] The training method of the contamination recognition model provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 obtains multiple current spectral images including different contamination areas on the equipment casing and the contamination level corresponding to the current spectral image, and uses the pre-built initial contamination recognition model to extract the original spectral data in the current spectral image, and based on the correlation between the original spectral data, extracts the target band in the extracted original spectral data through the initial contamination recognition model to reduce the data dimension of subsequent model training, and the target band retains the effective information in the original spectral data to the maximum extent, and then the contamination prediction of the current spectral image is performed based on the extracted target band, and then the initial contamination recognition model is iteratively trained based on the contamination prediction level and the contamination level to obtain a trained contamination recognition model, which is used to perform contamination prediction on the target spectral image and obtain the contamination level of the target spectral image.
[0071] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0072] In one embodiment, Figure 2 As shown, a method for training a dirt recognition model is provided, and the method is applied to Figure 1 The server 104 in FIG. 1 is used as an example to illustrate. It is understandable that the method can also be applied to Figure 1 The terminal 102 in the embodiment may also be applied to a system including the terminal 102 and the server 104, and implemented through interaction between the terminal 102 and the server 104. The method of this embodiment includes:
[0073] Step 201, obtaining a training data set.
[0074] Among them, the training data set refers to a data set used to train the pre-built initial contamination recognition model, and the training data set includes multiple current spectral images of different contamination areas on the equipment casing and the contamination levels corresponding to the current spectral images. The training data set contains multiple current spectral images and their corresponding contamination levels. The current spectral images are used as input features for model training, and the contamination levels are used as corresponding output labels, so that the initial contamination recognition model constructs a mapping relationship between the input current spectral images and the output contamination levels. In this embodiment, the training data set can be pre-built and stored in the data storage system, or it can be constructed in a targeted manner according to the actual contamination prediction needs at the moment.
[0075] The equipment casing refers to a structure used to wrap and protect the outside of the equipment. The equipment casing not only plays an insulating role, but also prevents external dirt (such as dust, moisture, etc.) from entering the inside of the equipment, thereby protecting the normal operation of the equipment. In this embodiment, the equipment mainly refers to high-voltage equipment in the power system, and the casing mainly refers to the casing wrapped around the cables, wires, insulators, and wall-penetrating structures of the converter station of the high-voltage equipment.
[0076] Among them, the spectral image refers to data that combines spectral information and image information, which can not only display spatial information such as the shape, size and position of an object, but also provide the spectral characteristics of the object at different wavelengths. In this embodiment, the current spectral image refers to a spectral image obtained by image acquisition of a contaminated sample (i.e., the equipment casing) and used to construct a training data set. The current spectral image can be an infrared image, an ultraviolet image, a visible light image, etc.; the current spectral image can reflect the spectral characteristics of the contaminated area on the equipment casing, so that the initial contamination recognition model can identify the contamination level reflected by the spectral characteristics. In this embodiment, the current spectral image is acquired by an imaging system and can be a hyperspectral image or a multispectral image. The current spectral image may be a spectral image obtained by pre-capturing images of the equipment casing in actual use, so as to obtain a spectral image that can better reflect the actual operation of the equipment casing, thereby improving the accuracy of the contamination identification model; of course, the current spectral image may also be a spectral image obtained by capturing images of multiple casing samples, and the casing samples are samples obtained by contaminating to different degrees using different contamination methods. The contamination methods may include but are not limited to quantitative brushing method, spraying method, immersion method, etc. When contaminating, different reagents may also be used for contamination, so as to obtain a current spectral image with rich pollution types, thereby improving the generalization ability of the contamination identification model.
[0077] The dirty area refers to the area on the equipment casing that is covered with dirt or impurities such as dust, grease, and salt. The existence of the dirty area may damage the equipment casing, thereby reducing its insulation performance and even causing failures. The contamination level refers to the severity of contamination in the dirty area on the equipment casing. The contamination level can be divided according to factors such as the type, quantity, and distribution of the contaminants. Accurately identifying and evaluating the contamination level of the dirty area is conducive to formulating corresponding cleaning and maintenance plans to ensure the normal operation and safety of the equipment.
[0078] Exemplarily, according to pollution prediction requirements, the server obtains a pre-built training data set from a data storage system or obtains a real-time built training data set from the outside.
[0079] Step 202: Input the current spectral image into a pre-built initial pollution recognition model to perform spectral extraction to obtain original spectral data.
[0080] The initial pollution identification model refers to a pre-built machine learning or deep learning model used to identify and analyze the pollution conditions of the pollution area reflected in the current spectral image. The initial pollution identification model can be implemented based on at least one of linear discriminant analysis (LDA), quadratic discriminant analysis (QDA), soft quadratic surface support vector machine (QSVM), linear support vector machine (LSVM) and k-nearest neighbor (KNN).
[0081] Among them, spectral extraction refers to the process of extracting spectral data of the contaminated area on the equipment casing from the current spectral image; the spectral extraction process usually includes preprocessing of the current spectral image, selection of the extraction area, and extraction of spectral data based on the selected area.
[0082] The original spectral data refers to the spectral data extracted from the current spectral image to reflect the spectral characteristics of the contaminated area. The original spectral data is usually expressed in the form of intensity values or reflectivity values corresponding to a series of wavelengths. The original spectral data is used to represent the reflection or absorption characteristics of different contaminants or impurities at different wavelengths. Since different contaminants or impurities have different performances on the spectrum, the contaminants and impurities in the contaminated area can be identified and analyzed through the spectral data, thereby determining the contamination level corresponding to the contaminated area.
[0083] Exemplarily, the server obtains a pre-built contamination recognition model, and inputs the current spectral image in the training data set into the initial contamination recognition model, and extracts the spectral information in the current spectral image through the initial contamination recognition model to obtain the corresponding original spectral information in each current spectral image.
[0084] Step 203: determining the target band based on the correlation between adjacent bands in each original spectral data by using the initial contamination identification model.
[0085] Among them, adjacent bands refer to a series of adjacent bands divided from the spectral characteristic curve formed by arranging the original spectral data corresponding to each current spectral image in order of wavelength size. Each band can correspond to a specific wavelength range between two original spectral data, or it can correspond to a specific original spectral data. When a band corresponds to a specific original spectral data, the band can be expressed as a wavelength range interval of the original spectral data within a narrower range above and below it. At this time, the value of the original spectral data representing the band is the spectral data corresponding to the center wavelength in the band or a representative wavelength.
[0086] The correlation between adjacent bands refers to the degree of association between the intensity values or reflectance values between two adjacent bands in the spectral characteristic curve. The correlation can be quantified by calculating the correlation coefficient, covariance or mutual information between adjacent bands; for example, when the correlation coefficient between two adjacent bands is determined by the correlation coefficient, the closer the correlation coefficient between the two bands is to 1 or -1, the stronger the correlation between the adjacent bands is, and vice versa, the closer it is to 0, the weaker the correlation between the adjacent bands is. By analyzing the correlation between adjacent bands, it can help identify redundant information in the original spectral data, so as to help the initial pollution recognition model to more accurately locate and identify the pollution level of the pollution area.
[0087] Among them, the target band refers to the band used to train the initial pollution identification model after analyzing the correlation between adjacent bands through the initial pollution identification model; the target band is the band that contains a lot of effective information in all bands of the spectral characteristic curve and the remaining band after removing redundant information. In this way, the amount of data samples can be reduced to a large extent, while ensuring the accuracy of model training and improving the training efficiency of the model. In specific implementation, in order to improve the prediction accuracy of pollution level, the band in the near infrared to mid-infrared range can be preferentially selected as the target band.
[0088] Exemplarily, the server processes each raw spectral data by calling an initial contamination identification model to determine a target band from each band based on the correlation between adjacent bands in a spectral characteristic curve formed by the raw spectral data.
[0089] Step 204: perform pollution prediction on the target band using the initial pollution recognition model, and output the pollution prediction level corresponding to the current spectral image.
[0090] Among them, pollution prediction refers to the process of processing the target band using the initial pollution recognition model to determine the correspondence between the wavelength and the reflectivity and intensity value in the target band, and then identifying the pollution features on the current spectral image, and predicting the pollution situation on the current spectral image based on these pollution features.
[0091] The pollution prediction level refers to dividing the pollution conditions on the current spectral image into different levels or categories according to the pollution prediction result.
[0092] Exemplarily, the server performs pollution prediction on the selected target band by calling the initial pollution recognition model, and outputs the pollution prediction level corresponding to the current spectral image.
[0093] Step 205, based on the data difference between the pollution prediction level and the pollution level, the initial pollution recognition model is iteratively trained until the end condition is met to obtain a trained pollution recognition model.
[0094] The data difference between the pollution prediction level and the pollution level refers to the difference between the pollution level predicted by the initial pollution identification model and the pollution level actually observed or defined according to the standard.
[0095] The trained pollution recognition model is used to predict pollution based on the input target spectral image to obtain the pollution level corresponding to the target spectral image.
[0096] Exemplarily, the server determines the data difference between the pollution prediction level and the pollution level, and uses the data difference to optimize and update the model parameters of the initial pollution recognition model, and iterates until the end condition of model training is reached to obtain a trained pollution recognition model. The end condition of model training can be reaching a set maximum number of iterations, or it can be that the defined loss function tends to be stable or converged.
[0097] In the training method of the above-mentioned pollution recognition model, by obtaining multiple current spectral images including different pollution areas on the equipment casing and the pollution levels corresponding to the current spectral images, the current spectral images are input into the pre-built initial pollution recognition model, and the original spectral data in the current spectral image are extracted by using the initial pollution recognition model to obtain the original spectral data, and the target band is determined based on the correlation between adjacent bands in each original spectral data through the initial pollution recognition model to reduce the data dimension of subsequent model training, and the effective information in the original spectral data is retained in the target band to the maximum extent, which is conducive to improving the quality of training data; then, through the initial pollution recognition model, the original spectral data in the current spectral image is extracted to obtain the original spectral data. The pollution recognition model predicts the pollution of the target band and outputs the pollution prediction level corresponding to the current spectral image. Based on the data difference between the pollution prediction level and the pollution level, the initial pollution recognition model is iteratively trained until the end condition is reached to obtain a trained pollution recognition model for pollution prediction of the target spectral image to obtain the pollution level of the target spectral image. The target band used for model training contains a large amount of effective information and is the remaining band after removing redundant information. In this way, the data sample size can be greatly reduced, the difficulty of data processing for the initial pollution recognition model can be reduced, and the model training accuracy can be guaranteed while improving the model training efficiency.
[0098] In one embodiment, Figure 3 As shown, the method for obtaining original spectral data in step S202 includes:
[0099] Step S301: input the current spectral image into a pre-built initial pollution recognition model.
[0100] Exemplarily, the server inputs the current spectral image in the training data set into a pre-built initial contamination recognition model.
[0101] Step S302, performing black-and-white correction on each current spectral image through the initial contamination recognition model to obtain a whiteboard correction image and a blackboard correction image corresponding to each current spectral image, and obtaining a corrected current spectral image according to the whiteboard correction image and the blackboard correction image.
[0102] Among them, black and white correction refers to the process of eliminating or reducing the brightness or reflectivity inconsistency, color deviation and other conditions caused by factors such as uneven illumination or imaging system response differences in the current spectral image. Black and white correction includes blackboard correction and whiteboard correction; blackboard correction uses a standard blackboard that can completely absorb all wavelengths as a reference to adjust the dark part or background noise in the current spectral image to ensure that the black part in the current spectral image can truly reach zero reflectivity; whiteboard correction uses a standard whiteboard that can completely reflect all wavelengths as a reference to adjust the brightness or reflectivity in the current spectral image, thereby eliminating the impact of uneven illumination.
[0103] The corrected current spectral image refers to a spectral image after black and white correction processing. The corrected current spectral image has eliminated uneven lighting and color deviation and can more accurately reflect the spectral characteristics of the surface of the equipment casing.
[0104] Among them, since the reflectivity spectrum of the spectral image is usually defined as the ratio of the reflected light intensity to the incident light intensity, the reflected light intensity and the incident light intensity are measured according to the standard white light reference, and the reflectivity spectrum function is constructed based on the relationship between the reflectivity spectrum and the reflected light intensity and the incident light intensity to determine the reflectivity spectrum of the spectral image. Among them, the reflectivity spectrum is a spectral characteristic that describes the ability of the surface of an object to reflect light. It represents the ratio of the light intensity reflected by the surface of an object to the light intensity incident on the surface at a certain wavelength. The reflectivity spectrum is expressed as:
[0105] (1)
[0106] in, is the reflectance spectrum, is the wavelength, is the reflected light intensity, is the incident light intensity.
[0107] Exemplarily, based on the above, the server calls the initial contamination recognition model, performs blackboard correction on each current spectral image using a standard blackboard with a reflectivity of 0% to obtain a blackboard correction image corresponding to each current spectral image, and performs whiteboard correction on each current spectral image using a standard whiteboard with a reflectivity of 100% to obtain a whiteboard correction image corresponding to each current spectral image, and obtains the corrected current spectral image based on the whiteboard correction image and the blackboard correction image.
[0108] Among them, the corrected current spectral image (data) is expressed as:
[0109] (2)
[0110] in, is the corrected current spectral image (data), is the current spectral image (data) before correction, For the blackboard calibration image (data), Calibrate the image (data) for the white board.
[0111] Step S303 , performing edge detection, pooling processing, and region of interest extraction on each corrected current spectral image in turn, and determining original spectral data of each contaminated region based on average spectral data in the region of interest.
[0112] Wherein, edge detection refers to identifying the edge or contour of the corrected current spectral image to extract the boundary of the dirty area in the current spectral image. In this embodiment, edge detection can be implemented by an edge detection algorithm, and the edge detection algorithm includes but is not limited to at least one of the Canny algorithm, the Sobel algorithm, and the Laplace algorithm.
[0113] The pooling process refers to downsampling the dirty area extracted by edge detection to reduce the resolution of the corrected spectral image while retaining the key features of the dirty area. In this embodiment, the pooling process can be implemented by methods including but not limited to maximum pooling, average pooling, etc.
[0114] The region of interest refers to the sub-image containing the contamination area extracted from the corrected spectral image to reduce the amount of data for subsequent processing and improve the accuracy of contamination detection. The average spectral data refers to the value obtained by averaging the spectral data of all pixels in the extracted region of interest. The average value can represent the average spectral characteristics of the contamination area and is used as the original spectral data for subsequent analysis and identification.
[0115] Exemplarily, the server first uses the Canny algorithm to perform edge detection on the corrected current spectral image to obtain an image of the dirty area; then, the server performs pooling processing on the detected dirty area, that is, binarization and segmentation of the image of the dirty area to generate a mask; then, the server selects the corresponding area (that is, the dirty area) as the area of interest according to the mask, calculates the average spectral data of the area of interest, and determines the average spectral data as the original spectral data of the corresponding dirty area.
[0116] In this embodiment, black-and-white correction is performed on each current spectral image through the initial contamination recognition model to obtain a whiteboard correction image and a blackboard correction image corresponding to each current spectral image. The corrected current spectral image is obtained according to the whiteboard correction image and the blackboard correction image. Through the black-and-white correction, the dark current and background noise in the current spectral image can be eliminated, and the influence of uneven illumination on image recognition can be reduced, so that the identification of the contaminated area is more accurate. On this basis, edge detection, pooling processing and region of interest extraction are performed on each corrected current spectral image in turn. Based on the average spectral data in the region of interest, the original spectral data of each contaminated area is determined. The original spectral data of the contaminated area can be accurately determined, providing a reliable basis for subsequent analysis and identification.
[0117] In one embodiment, determining the target band based on the correlation between adjacent bands in each original spectral data includes:
[0118] Baseline correction is performed on each original spectral data to obtain the corrected spectral data corresponding to each original spectral data, and a spectral characteristic curve is constructed based on the corrected spectral data; based on the correlation between adjacent bands in the spectral characteristic curve, characteristic bands are extracted according to a preset number, and bands that meet preset conditions are determined from the characteristic bands as target bands.
[0119] Among them, since the interference of atmospheric scattering and the like will increase the error of the original spectral data analysis process, it is necessary to perform baseline correction on the original spectral data. Baseline correction refers to the correction of the baseline drift or offset of the original spectral data to eliminate the baseline drift or offset caused by factors such as instrument background, unstable light source or environmental interference in the original spectral data, so as to ensure the accuracy of the original spectral data, so that the shape and characteristics of the spectral characteristic curve can truly reflect the properties of the contaminants or impurities in the contaminated area on the surface of the measured equipment casing. In this embodiment, methods including but not limited to curve fitting (such as binomial curve fitting) and multiple scattering correction (MSC) can be used to obtain the corrected spectral data.
[0120] The corrected spectral data refers to spectral data obtained after baseline correction, so as to more truly reflect the properties of the contaminants or impurities in the contaminated area being measured.
[0121] The spectral characteristic curve refers to a curve drawn with wavelength as the independent variable and spectral intensity (or absorbance, reflectivity, etc.) as the dependent variable, which is used to describe the spectral characteristics of the measured substance at different wavelengths. The spectral characteristic curve has multiple bands corresponding to the spectral data before and after correction, which are divided according to the preset wavelength range.
[0122] Among them, the characteristic band refers to the band in the spectral characteristic curve that can reflect the main characteristics or components of the contaminants or impurities in the measured contamination area. By extracting the characteristic band and further extracting the target band from the characteristic band according to preset conditions, the data dimension can be reduced, the calculation efficiency can be improved, and sufficient information can be retained for subsequent identification of the contamination level.
[0123] Exemplarily, the server performs baseline correction on each raw spectral data to eliminate the baseline drift or offset of the raw spectral data, obtains the corrected spectral data corresponding to each raw spectral data, and constructs a spectral characteristic curve based on the corrected spectral data. Subsequently, the server extracts characteristic bands according to a preset number based on the correlation between adjacent bands in the spectral characteristic curve, and determines the bands that meet the preset conditions from the characteristic bands as the target bands.
[0124] Among them, in this embodiment, by performing baseline correction on each original spectral data respectively, the corrected spectral data corresponding to each original spectral data is obtained, and the spectral characteristic curve is constructed based on the corrected spectral data, which can eliminate the baseline drift or offset caused by factors such as instrument background, light source instability or environmental interference in the original spectral data, ensure the accuracy of the original spectral data, so that the shape and characteristics of the spectral characteristic curve can truly reflect the properties of the contaminants or impurities in the contaminated area on the surface of the equipment casing under test. Subsequently, based on the correlation between adjacent bands in the spectral characteristic curve, characteristic bands are extracted according to a preset number, and bands that meet preset conditions are determined from the characteristic bands as target bands, which can reduce data dimensions, improve calculation efficiency, and retain sufficient information for subsequent identification of contamination levels.
[0125] In one embodiment, a multiple scattering correction (MSC) method is used to perform baseline correction on each raw spectral data, and the correction process includes:
[0126] The average values of each original spectral data are determined respectively, and the standard spectral data of each original spectral data are obtained according to the average values; the offset and translation of the original spectral data relative to the standard spectral data are determined; the original spectral data are corrected based on the offset and translation to obtain corrected spectral data.
[0127] The average value of the original spectrum data refers to the value describing the center position or average level of each original spectrum data. The standard spectrum data refers to an idealized spectrum data obtained based on the average value of the original spectrum data, which is used as a calibration benchmark.
[0128] The offset refers to the difference in reflectance or intensity between the original spectrum data and the standard spectrum data, which is used to reflect the degree of offset of the original spectrum data relative to the standard spectrum data. The translation refers to the relative position difference between the original spectrum data and the standard spectrum data at the corresponding wavelength, which is used to reflect the reflectance error of the original spectrum data relative to the standard spectrum data at the same wavelength.
[0129] Exemplarily, for each group of raw spectral data, including multiple spectral data, the server calculates the average value of each group of raw spectral data, and determines the average value as the standard spectral data of the raw spectral data of the corresponding group. Specifically, the raw spectral data is divided according to wavelength intervals, and the average value of each raw spectral data within each wavelength interval is calculated to determine the standard spectral data corresponding to the wavelength interval, which is expressed as:
[0130] (3)
[0131] in, For the The average value of each original spectral data in the wavelength interval is , is the number of wavelength intervals divided; For the A set of original spectral data (i.e. The original spectral data corresponding to the current spectral image) Spectral data (i.e. reflectance values) for wavelength ranges, , is the number of groups of original spectral data, that is, the number of current spectral images.
[0132] Subsequently, the server uses a univariate linear regression to determine the offset and translation of the original spectrum data relative to the standard spectrum data. The offset can be represented by the slope of the linear regression, and the translation can be represented by the intercept of the current regression, thereby obtaining the following formula:
[0133] (4)
[0134] in, For the The offset of the original spectral data. For the The amount of shift of the original spectral data.
[0135] Finally, the server corrects the original spectral data based on the offset and translation to obtain the corrected spectral data. The corrected spectral data is expressed as:
[0136] (5)
[0137] in, is the spectral data after correction.
[0138] In this embodiment, by respectively determining the average values of each raw spectral data, obtaining the standard spectral data of each raw spectral data according to each average value, and determining the offset and translation of the raw spectral data relative to the standard spectral data, and then correcting the raw spectral data based on the offset and translation to obtain the corrected spectral data, the spectral differences caused by different scattering levels can be effectively eliminated, and the correlation between the spectrum and the contamination level can be enhanced.
[0139] In one embodiment, Figure 4 As shown, based on the correlation between adjacent bands in the spectral characteristic curve, characteristic bands are extracted according to a preset number, and bands that meet preset conditions are determined from the characteristic bands as target bands, including:
[0140] Step S401 , dividing each band in each spectral characteristic curve into a modeling set and a verification set according to a preset ratio.
[0141] Among them, the modeling set is used to extract feature bands, and the validation set is used to further extract feature bands to obtain target bands.
[0142] Exemplarily, the server divides each band in each spectral characteristic curve according to a preset ratio to obtain a modeling set and a verification set. The preset ratio may be 3:1, 4:1, etc.
[0143] Step S402, determining a current modeling set, and selecting a band from the current modeling set to be determined as a current modeling sample, and using the current modeling sample to initialize a current operation vector of the continuous projection algorithm.
[0144] The current modeling set refers to the modeling set used for data processing at the current moment. In the initialization phase, the current modeling set is the first modeling set. In each subsequent iteration, the modeling set is the unselected modeling set until all modeling sets are processed. The current modeling sample refers to the modeling sample corresponding to the band selected from the current modeling set, which is used to initialize the continuous projection algorithm.
[0145] Among them, the Successive Projection Algorithm (SPA) iteratively selects bands from the current modeling set. Each band selection is based on the maximum correlation between the unselected sample set composed of the remaining bands and the band selected at that time, as well as the minimum redundancy between features, so as to reduce the data dimension.
[0146] The current operation vector refers to the vector used to calculate feature correlation and redundancy in each iteration of the continuous projection algorithm. In the initialization phase, the current operation vector is composed of the current modeling sample. In each subsequent iteration, new bands (or modeling samples) are added to this vector until the end condition is reached, thereby determining the feature band.
[0147] Exemplarily, the server determines a modeling set from all modeling sets as the current modeling set, and randomly selects a band from the current modeling set as the current modeling sample, and uses the current modeling sample to initialize the current operation vector of the continuous projection algorithm. The initialization process is as follows:
[0148] (6)
[0149] in, is the current operation vector of the continuous projection algorithm, No. bands in the current modeling set, , is the number of bands in the current modeling set, is the iteration counter. In the initialization phase, , with each subsequent iteration, Gradually add 1, , is the number of iterations, that is, the preset number of characteristic bands selected, .
[0150] Step S403: adding the current operation vector to the selected sample set.
[0151] Among them, the selected sample set is determined based on the spectral data selected and processed historically, that is, the selected sample set refers to the sample set composed of the bands (vectors) that have been selected from the current modeling set in the initialization phase and each subsequent iteration. Correspondingly, there is also an unselected sample set, which is the complement of the selected sample set on the corresponding modeling set, that is, the unselected sample set is the sample set composed of the remaining bands (vectors) after the bands are selected from the current modeling set.
[0152] Exemplarily, the server adds the current operation vector to the selected sample set. The unselected sample set is represented as:
[0153] (7)
[0154] in, is the unselected sample set.
[0155] Step S404, for each modeling set, determine the current projection vector of each band in the unselected sample set of the modeling set on the selected sample set, and use the current projection vector that meets the conditions in each current projection vector as the new current operation vector, return to execute the step of adding the current operation vector to the selected sample set, until the end condition is met, and obtain a feature band.
[0156] The current projection vector refers to the projection of the current operation vector on the unselected sample set. The qualified current projection vector refers to the current projection vector that meets the specific conditions among all the determined current projection vectors. In this embodiment, the qualified current projection vector specifically refers to the current projection vector with the largest projection value.
[0157] The end condition refers to determining that a preset number of characteristic bands are obtained in the current modeling set.
[0158] Exemplarily, for each modeling set, the server first determines the current projection vector of each band in the unselected sample set of each modeling set on the selected sample set. The current projection vector is expressed as:
[0159] (8)
[0160] in, For the Bands in the current modeling set The corresponding vector in the unselected sample set Projections onto other vectors in .
[0161] Next, the server determines the sequence number of the current projection vector with the largest projection value from all current projection vectors, that is:
[0162] (9)
[0163] in, It is the index set of the current projection vector with the largest projection value.
[0164] Subsequently, the server uses the current projection vector with the largest projection value as the new current operation vector to allocate the projection operation vector for the next iteration, that is:
[0165] (10)
[0166] Finally, the server increments the iteration counter by 1, i.e. , if the accumulated , then return to step S403 to iterate until , the iteration is completed, and the current projection vector at this time is determined as the characteristic band.
[0167] Step S405, when the number of characteristic bands does not reach the preset number, a new modeling set is determined as the current modeling set, and the process returns to the step of selecting a band from the current modeling set as the current modeling sample, and using the current modeling sample to initialize the current operation vector of the continuous projection algorithm until the preset number of characteristic bands is obtained.
[0168] Exemplarily, the server counts the number of characteristic bands obtained in step S404 to determine whether the number of characteristic bands reaches a preset number. , it means that the number of characteristic bands has not reached the preset number, and the server will Add 1, that is , and select a modeling set from the remaining unprocessed modeling sets as the current modeling set, and return to step S402 to iterate until , and obtain multiple characteristic bands.
[0169] Step S406 , determining a band that meets the preset condition based on the verification set, the current projection vector that meets the condition, and the characteristic band, and determining the band that meets the preset condition as the target band.
[0170] Exemplarily, the server sets the index of the current projection vector with the largest projection value , perform multiple linear regression (MLR) on N feature bands, and calculate the root mean square error of the validation set, the index set of the current projection vector with the largest projection value The band corresponding to the minimum root mean square error among the N characteristic bands is determined as the target band.
[0171] In an exemplary embodiment, the target band determined based on the continuous projection algorithm is as follows: Figure 5 As shown in the figure, the root mean square error decreases rapidly after three target bands are selected, and reaches a stable minimum after six target bands are selected, that is, six target bands are selected, which are bands in a smaller range corresponding to the central wavelengths of 549.1nm, 650.5nm, 716.2nm, 775.9nm, 790.1nm, and 927.6nm, and are evenly distributed from visible to near-infrared.
[0172] In this embodiment, a continuous projection algorithm is used to extract characteristic bands, and a small number of bands are selected from the original spectral data as characteristic bands. The characteristic bands are then processed using multiple linear regression, and the root mean square error of the characteristic bands on the validation set is calculated to determine the target bands. These target bands contain most of the spectral information in the spectral image, and can also effectively reduce the data dimension and the amount of data to be processed.
[0173] In one embodiment, the training method of the above-mentioned contamination recognition model further includes:
[0174] Based on the reflectivity levels of the corrected spectral data, the bands corresponding to each corrected spectral data are clustered to obtain a plurality of cluster data sets with different reflectivity levels.
[0175] Clustering the bands means classifying each band according to reflectivity. In this embodiment, when clustering, at least one of a hierarchical clustering algorithm, a segmentation clustering algorithm, a constraint-based clustering algorithm, a clustering algorithm in machine learning, and a clustering algorithm for high dimensions can be used.
[0176] Based on the above, each band in each spectral characteristic curve is divided into a modeling set and a verification set according to a preset ratio, including:
[0177] Each clustering data set is divided according to a preset ratio to obtain a modeling set and a validation set for each clustering data set.
[0178] Exemplarily, the server determines the reflectivity level of each corrected spectral data respectively, and clusters the bands corresponding to each corrected spectral data according to the reflectivity level to obtain multiple cluster data sets with different reflectivity levels; then, the server divides each cluster data set according to a preset ratio to obtain a modeling set and a verification set for each cluster data set.
[0179] In this embodiment, the corrected spectral data is clustered according to the reflectance level. Since the reflectance is positively correlated with the pollution level, the pollution level reflected by each band in each clustered data set is close. In the subsequent data processing process, the correlation between the bands in each clustered data set is higher, thereby ensuring the effectiveness of the subsequent target band extraction.
[0180] In one embodiment, Figure 6 As shown, a method for identifying contamination in a device casing is provided, and the method is applied to Figure 1 The server in the example is used for explanation. It is understandable that the method can also be applied to Figure 1 The terminal 102 in the embodiment may also be applied to a system including the terminal 102 and the server 104, and implemented through interaction between the terminal 102 and the server 104. The method of this embodiment includes:
[0181] Step S601: acquiring a target spectral image of the surface of the device casing to be identified.
[0182] The target spectral image is a spectral image of the surface of the equipment casing that needs to be identified for contamination level, which is collected by an imaging system.
[0183] Exemplarily, the server obtains a target spectral image of the surface of the device casing to be identified.
[0184] Step S602: input the target spectrum image into the pollution recognition model.
[0185] The contamination recognition model is trained based on the method in the above embodiment.
[0186] Exemplarily, the server obtains a trained pollution recognition model and inputs the target spectral image into the pollution recognition model.
[0187] Step S603: outputting the pollution level corresponding to the target spectrum image based on the pollution recognition model to obtain the pollution recognition result of the surface of the equipment casing.
[0188] Exemplarily, the server performs contamination prediction on the target spectral image by calling the contamination recognition model, and outputs the contamination level corresponding to the target spectral image, so as to obtain the contamination recognition result of the surface of the equipment casing according to the contamination level.
[0189] The above-mentioned equipment casing contamination identification method obtains the target spectral image of the surface of the equipment casing to be identified, and inputs the target spectral image into the contamination identification model to predict the contamination level, thereby obtaining the contamination identification result of the equipment casing surface. Through contamination prediction, potential contamination problems of various electrical equipment in the power system can be discovered in advance, and corresponding measures can be taken to prevent and deal with them, thereby avoiding or reducing the occurrence of flashover accidents and ensuring the safe operation of electrical equipment in the power system.
[0190] In one embodiment, the above-mentioned device casing contamination identification method further includes: using a pseudo-color image to visualize the contamination identification result.
[0191] Among them, the pseudo-color image refers to a color image generated by mapping different gray levels or data values of a grayscale image (or other types of multi-band images, such as infrared, ultraviolet, etc.) to specific colors.
[0192] Exemplarily, the server visualizes the predicted contamination identification result using a pseudo-color map.
[0193] In this embodiment, by visualizing the predicted contamination identification result, the identification result of the contamination level can be made more intuitive, so that the evaluation of the contamination degree of the surface of the equipment casing can be more accurate and objective.
[0194] 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.
[0195] Based on the same inventive concept, the embodiment of the present application also provides a training device for a dirt recognition model for implementing the training method for the dirt recognition model 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 the embodiments of the training device for one or more dirt recognition models provided below can refer to the limitations of the training method for the dirt recognition model above, and will not be repeated here.
[0196] In an exemplary embodiment, Figure 7As shown, a training device for a pollution identification model is provided, comprising: a data acquisition module 701, a spectrum extraction module 702, a band selection module 703, a pollution prediction module 704 and an iterative training module 705, wherein:
[0197] The data acquisition module 701 is used to acquire a training data set, where the training data set includes a plurality of current spectral images of different contamination areas on the equipment casing and contamination levels corresponding to the current spectral images.
[0198] The spectrum extraction module 702 is used to input the current spectrum image into the pre-built initial pollution recognition model to perform spectrum extraction and obtain original spectrum data.
[0199] The band selection module 703 is used to determine the target band based on the correlation between adjacent bands in each original spectral data through the initial contamination identification model.
[0200] The contamination prediction module 704 is used to perform contamination prediction on the target band through the initial contamination recognition model and output the contamination prediction level corresponding to the current spectral image.
[0201] The iterative training module 705 is used to iteratively train the initial contamination recognition model based on the data difference between the contamination prediction level and the contamination level until the end condition is reached to obtain a trained contamination recognition model; the trained contamination recognition model is used to perform contamination prediction on the input target spectral image to obtain the contamination level corresponding to the target spectral image.
[0202] In an optional embodiment, the spectral extraction module 702 is also used to input the current spectral image into a pre-constructed initial contamination recognition model; perform black and white correction on each current spectral image through the initial contamination recognition model to obtain a whiteboard correction image and a blackboard correction image corresponding to each current spectral image, and obtain a corrected current spectral image based on the whiteboard correction image and the blackboard correction image; perform edge detection, pooling processing and region of interest extraction on each corrected current spectral image in turn, and determine the original spectral data of each contamination region based on the average spectral data in the region of interest.
[0203] In an optional embodiment, the band selection module 703 is also used to perform baseline correction on each original spectral data, obtain corrected spectral data corresponding to each original spectral data, and construct a spectral characteristic curve based on the corrected spectral data; the spectral characteristic curve has multiple bands corresponding to the spectral data obtained by dividing according to a preset wavelength range; based on the correlation between adjacent bands in the spectral characteristic curve, characteristic bands are extracted according to a preset number, and bands that meet preset conditions are determined from the characteristic bands as target bands.
[0204] In an optional embodiment, the band selection module 703 is also used to determine the average values of each original spectral data respectively, and obtain the standard spectral data of each original spectral data according to each average value; determine the offset and translation of the original spectral data relative to the standard spectral data; and perform baseline correction on the original spectral data based on the offset and translation to obtain corrected spectral data.
[0205] In an optional embodiment, the band selection module 703 is also used to divide each band in each spectral characteristic curve into a modeling set and a verification set according to a preset ratio; determine the current modeling set, and select a band from the current modeling set to determine as the current modeling sample, and use the current modeling sample to initialize the current operation vector of the continuous projection algorithm; add the current operation vector to the selected sample set; the selected sample set is determined based on the historically selected and processed spectral data; for each modeling set, determine the current projection vector of each band in the unselected sample set of the modeling set on the selected sample set, and add the current projection vector that meets the conditions in each current projection vector The quantity is used as the new current operation vector, the new current operation vector is added to the selected sample set and the above process is repeated until the end condition is met to obtain a feature band; the unselected sample set is determined based on the selected sample set and the corresponding modeling set; when the number of feature bands does not reach the preset number, a new modeling set is determined as the current modeling set, and a band is selected from the newly determined current modeling set to be determined as the current modeling sample and then the signing process is repeated until a preset number of feature bands are obtained; a band that meets the preset conditions is determined based on the verification set, the current projection vector that meets the conditions and the feature band, and the band that meets the preset conditions is determined as the target band.
[0206] In an optional embodiment, the training device of the above-mentioned contamination recognition model also includes a clustering module, which is used to cluster the bands corresponding to each corrected spectral data based on the reflectivity level of the corrected spectral data to obtain multiple clustered data sets with different reflectivity levels; the reflectivity is positively correlated with the contamination level.
[0207] The band selection module 703 is also used to divide each cluster data set according to a preset ratio to obtain a modeling set and a verification set for each cluster data set.
[0208] Based on the same inventive concept, the embodiment of the present application also provides an equipment casing contamination identification device for implementing the equipment casing contamination identification 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 the embodiments of one or more equipment casing contamination identification devices provided below can refer to the limitations of the equipment casing contamination identification method above, and will not be repeated here.
[0209] In an exemplary embodiment, Figure 8 As shown, a device for identifying contamination of equipment casing is provided, comprising: an image acquisition module 801, an image input module 802 and a contamination identification module 803, wherein:
[0210] An image acquisition module 801 is used to acquire a target spectrum image of the surface of the device casing to be identified;
[0211] The image input module 802 is used to input the target spectrum image into the contamination recognition model; the contamination recognition model is trained by the contamination recognition model training method of the above embodiment or trained by the contamination recognition model training device of the above embodiment.
[0212] The contamination identification module 803 is used to output the contamination level corresponding to the target spectrum image based on the contamination identification model, and obtain the contamination identification result of the surface of the equipment casing.
[0213] In an optional embodiment, the above-mentioned equipment casing contamination identification device further includes a visualization module for visualizing the contamination identification result using a pseudo-color image.
[0214] Each module in the training device of the above-mentioned contamination identification model and the device for identifying contamination of equipment casing can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0215] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store training data sets, current spectral images, original spectral data, initial contamination recognition models, various bands and other data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for training a contamination recognition model or a method for identifying contamination in a device casing is implemented.
[0216] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the 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 those shown in the figure, or combine certain components, or have a different arrangement of components.
[0217] In an exemplary 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 steps of the method for training a contamination recognition model or the method for identifying contamination in a device casing of the above-mentioned embodiment are implemented.
[0218] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the contamination identification model training method or the equipment casing contamination identification method of the above-mentioned embodiment are implemented.
[0219] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps of the contamination identification model training method or the device casing contamination identification method of the above-mentioned embodiment.
[0220] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0221] 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.
[0222] 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.
[0223] 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 understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations 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 training a contamination recognition model, characterized in that: The method comprises: Acquire a training data set, the training data set including a plurality of current spectral images of different contamination areas on a device casing and contamination levels corresponding to the current spectral images; Inputting the current spectrum image into a pre-built initial pollution recognition model to perform spectrum extraction to obtain original spectrum data; Determining the target band based on the correlation between adjacent bands in each of the original spectral data by using the initial contamination identification model; Performing pollution prediction on the target band by using the initial pollution recognition model, and outputting the pollution prediction level corresponding to the current spectral image; Based on the data difference between the contamination prediction level and the contamination level, the initial contamination recognition model is iteratively trained until an end condition is reached to obtain a trained contamination recognition model; the trained contamination recognition model is used to perform contamination prediction on an input target spectral image to obtain a contamination level corresponding to the target spectral image.
2. The method according to claim 1, characterized in that The step of inputting the current spectral image into a pre-built initial pollution identification model to perform spectral extraction to obtain original spectral data includes: Inputting the current spectral image into a pre-built initial pollution recognition model; Performing black-and-white correction on each current spectral image by using the initial contamination recognition model to obtain a whiteboard correction image and a blackboard correction image corresponding to each current spectral image, and obtaining a corrected current spectral image according to the whiteboard correction image and the blackboard correction image; The corrected current spectral images are sequentially subjected to edge detection, pooling processing and region of interest extraction, and original spectral data of each contaminated region is determined based on average spectral data in the region of interest.
3. The method according to claim 1, characterized in that The determining of the target band based on the correlation between adjacent bands in each of the original spectral data by using the initial contamination identification model includes: Baseline correction is performed on each original spectral data to obtain corrected spectral data corresponding to each original spectral data, and a spectral characteristic curve is constructed based on the corrected spectral data; the spectral characteristic curve has a plurality of bands corresponding to the spectral data obtained by dividing according to a preset wavelength interval; Based on the correlation between adjacent bands in the spectral characteristic curve, characteristic bands are extracted according to a preset number, and bands that meet preset conditions are determined from the characteristic bands as target bands.
4. The method according to claim 3, characterized in that The baseline correction is performed on each original spectral data to obtain the corrected spectral data corresponding to each original spectral data, including: Determine the average values of each original spectral data respectively, and obtain the standard spectral data of each original spectral data according to each average value; Determine an offset and a translation of the original spectrum data relative to the standard spectrum data; Baseline correction is performed on the original spectral data based on the offset and the translation to obtain corrected spectral data.
5. The method according to claim 3, characterized in that: The extracting characteristic bands according to a preset number based on the correlation between adjacent bands in the spectral characteristic curve, and determining a band that meets a preset condition as a target band from the characteristic bands, comprises: Divide each band in each spectral characteristic curve into a modeling set and a verification set according to a preset ratio; Determine a current modeling set, select a band from the current modeling set to be determined as a current modeling sample, and use the current modeling sample to initialize a current operation vector of a continuous projection algorithm; adding the current operation vector to a selected sample set; the selected sample set is determined based on historically selected and processed spectral data; For each modeling set, respectively determine the current projection vector of each band in the unselected sample set of the modeling set on the selected sample set, and use the current projection vector that meets the conditions among the current projection vectors as the new current operation vector, return to execute the step of adding the current operation vector to the selected sample set until the end condition is met, and obtain a feature band; the unselected sample set is the complement of the selected sample set on the corresponding modeling set; When the number of the characteristic bands does not reach the preset number, a new modeling set is determined as the current modeling set, and the step of selecting a band from the current modeling set as the current modeling sample and initializing the current operation vector of the continuous projection algorithm using the current modeling sample is returned to be executed until the preset number of characteristic bands is obtained; A band that meets the preset condition is determined based on the verification set, the current projection vector that meets the condition, and the characteristic band, and the band that meets the preset condition is determined as a target band.
6. The method according to claim 5, characterized in that The method further comprises: Based on the reflectivity level of the corrected spectral data, the wavebands corresponding to each corrected spectral data are clustered to obtain a plurality of clustered data sets with different reflectivity levels; the reflectivity is positively correlated with the pollution level; The method of dividing each band in each spectral characteristic curve into a modeling set and a verification set according to a preset ratio includes: Each clustering data set is divided according to a preset ratio to obtain a modeling set and a validation set for each clustering data set.
7. A method for identifying equipment casing contamination, characterized in that: The method comprises: Acquire a target spectral image of the surface of the casing of the device to be identified; Inputting the target spectral image into a pollution recognition model; the pollution recognition model is trained based on the method according to any one of claims 1 to 6; The pollution level corresponding to the target spectral image is output based on the pollution identification model to obtain the pollution identification result of the surface of the equipment casing.
8. The method according to claim 7, characterized in that The method further comprises: The contamination identification results are visualized using a pseudo-color map.
9. A training device for a contamination recognition model, characterized in that: The device comprises: A data acquisition module, used to acquire a training data set, wherein the training data set includes a plurality of current spectral images of different contamination areas on the equipment casing and contamination levels corresponding to the current spectral images; A spectrum extraction module, used for inputting the current spectrum image into a pre-built initial pollution recognition model to perform spectrum extraction and obtain original spectrum data; A band selection module, used for determining a target band based on the correlation between adjacent bands in each of the original spectral data by using the initial contamination identification model; A contamination prediction module, used to perform contamination prediction on the target band through the initial contamination recognition model, and output a contamination prediction level corresponding to the current spectral image; An iterative training module is used to iteratively train the initial contamination recognition model based on the data difference between the contamination prediction level and the contamination level until an end condition is reached to obtain a trained contamination recognition model; the trained contamination recognition model is used to perform contamination prediction on an input target spectral image to obtain a contamination level corresponding to the target spectral image.
10. A device for identifying contamination of equipment casing, characterized in that: The device comprises: An image acquisition module, used to acquire a target spectral image of the surface of the device casing to be identified; An image input module, used for inputting the target spectral image into a contamination recognition model; the contamination recognition model is trained based on the method according to any one of claims 1 to 6 or trained by the device according to claim 9; The contamination recognition module is used to output the contamination level corresponding to the target spectral image based on the contamination recognition model to obtain the contamination recognition result of the surface of the equipment casing.
Citation Information
Cited By
Insulator surface defect detection method and system based on photometric stereoscopic vision
CN120451144A
Insulator surface defect detection method and system based on photometric stereo vision
CN120451144B