A power utilization equipment classification method, device, apparatus and medium
By training a Bayesian classification model for different defect scenarios and selecting an appropriate model for classification during the identification stage, the problem of reduced accuracy caused by missing features in the classification of electrical equipment is solved, and high accuracy and reliability of electrical equipment classification are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
- Filing Date
- 2026-04-28
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies suffer from reduced classification accuracy when classifying electrical equipment due to missing feature data. Existing methods, such as mean interpolation, introduce distorted information, affecting the judgment of the classification model.
By training classification models for different defect scenarios, the Bayesian classification method with kernel density is used, and prior probability and conditional probability are combined for model training. In the identification stage, the model with the highest accuracy that matches the current feature conditions is selected for classification.
It improves the accuracy and reliability of electrical equipment classification in scenarios with missing features, avoids noise interference caused by interpolation completion, and enhances the model's adaptability to situations with missing features.
Smart Images

Figure CN122241438A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power equipment identification technology, and in particular to a method, apparatus, equipment and medium for classifying power equipment. Background Technology
[0002] With the continuous improvement of the intelligence level of power systems and the widespread deployment of electricity consumption information collection systems, the power grid side can acquire massive amounts of operational data from electrical equipment. Accurate classification of electrical equipment helps to achieve functions such as refined load management, demand-side response, abnormal electricity consumption detection, and energy efficiency assessment, which is an important foundation for supporting intelligent dispatching and lean operation of the power system.
[0003] However, when classifying electrical equipment, existing technologies often suffer from missing feature data due to factors such as equipment malfunctions, communication anomalies, data packet loss, or limited sensing capabilities in different scenarios, resulting in feature deficiencies. To address the common problem of missing feature information during data acquisition, existing technologies often use mean interpolation to complete the data. This method generates interfering information that does not reflect reality, thus affecting the classification model's judgment and reducing the accuracy of electrical equipment classification. Summary of the Invention
[0004] This application provides a method, apparatus, device, and medium for classifying electrical equipment, which can improve the accuracy of electrical equipment classification in scenarios with missing features.
[0005] Some embodiments of this application provide a method for classifying electrical equipment, including: Based on a pre-defined dataset of electrical equipment, several classification models corresponding to pre-defined characteristic defect scenarios are trained, and the classification accuracy of each of the first classification models is verified; wherein, each characteristic defect scenario corresponds to a first feature category set. Receive feature data corresponding to the electrical equipment to be identified, and determine the second feature category set corresponding to the feature data; Select a third feature category set that is a non-empty subset of the second feature category set from the first feature category set, and use the classification model corresponding to each third feature category set as the first classification model; The target classification model with the highest classification accuracy is determined from the first classification model, and the feature data is input into the target classification model to obtain the classification result of the electrical equipment to be identified.
[0006] Compared to existing technologies, the above embodiments have the following beneficial effects: Addressing the technical problem that existing technologies rely on mean interpolation and other methods to complete data in scenarios with missing features, introducing distorted information and thus reducing classification accuracy, this application pre-trains corresponding classification models for different feature defect scenarios. During the identification stage, based on the actual feature category set of the electrical equipment to be identified, it selects the target classification model from multiple candidate models that matches the current feature conditions and has the highest classification accuracy for classification processing. Since this application does not manually complete missing features but directly selects the appropriate model based on existing effective features, it avoids noise interference caused by interpolation completion. Simultaneously, by constructing multiple models for different feature subsets and optimizing them based on accuracy, the model can better adapt to changes in feature categories, improving robustness and adaptability in feature defect scenarios. Based on the above technical means, this application can maintain high classification accuracy even with incomplete feature information, thereby significantly improving the accuracy and reliability of electrical equipment classification.
[0007] Furthermore, the step of training several classification models corresponding to preset feature defect scenarios based on a preset electrical equipment dataset includes: Based on the first feature category set corresponding to each of the aforementioned feature defect scenarios, a corresponding training dataset is generated based on the electrical equipment dataset; wherein, the features of the sample data in the training dataset are the same as the features in the first feature category set; Based on each of the training datasets, a pre-defined Bayesian classification model based on kernel density is trained to obtain the classification model corresponding to each of the feature defect scenarios.
[0008] Compared with existing technologies, the above embodiments have the following beneficial effects: By generating matching training datasets for the first feature category set corresponding to each feature defect scenario, and training the corresponding classification models respectively, each classification model is optimized under specific feature subset conditions, thereby enhancing the model's ability to adapt to feature missing situations; furthermore, by introducing a Bayesian classification model based on kernel density, the probability density can be nonparametrically estimated without relying on prior assumptions about feature distribution, improving the modeling ability under complex electricity consumption data distribution, thereby improving the accuracy of classification results.
[0009] Furthermore, the pre-set kernel density-based Bayesian classification model for training includes: The prior probability of each equipment category is determined based on the proportion of samples of the equipment category in the training dataset. For each feature category in the training dataset, the probability density function of the feature category under each device category is fitted by the kernel density estimation method to obtain the conditional probability. Based on the prior probability and the conditional probability, the posterior probability is calculated based on Bayes' theorem to complete the training of the Bayesian classification model.
[0010] Compared with existing technologies, the above embodiments have the following beneficial effects: by combining the sample proportion to determine the prior probability, and using the kernel density estimation method to obtain the conditional probability of each feature under different device categories, and then calculating the posterior probability based on Bayes' theorem, the classification model can be refined and trained. This method can make full use of the statistical characteristics of the data, improve the accuracy of probability estimation, and enable the model to still have strong discriminative ability when the features are fluctuating or incomplete, thereby further improving the reliability of the classification results.
[0011] Further, the step of inputting the feature data into the target classification model to obtain the classification result of the electrical equipment to be identified includes: Based on the third feature category set of the target classification model, corresponding input data is extracted from the feature data; wherein the features of the input data are the same as the features of the third feature category set. The input data is input into the target classification model to obtain the probability that the electrical equipment to be identified belongs to each of the equipment categories; The device category with the highest probability is selected as the classification result of the electrical device to be identified.
[0012] Compared with existing technologies, the above embodiments have the following advantages: by extracting only input data that is consistent with the third feature category set corresponding to the target classification model, the interference of irrelevant or missing features on the classification process is avoided, and the device category is determined by probability output, so that the classification result has a clear confidence basis; this method improves the matching degree between model input and model structure, thereby improving the stability and accuracy of the classification process.
[0013] Further, the selection of the third feature category set from the first feature category set as a non-empty subset of the second feature category set includes: Obtain the power set of the second feature category set, wherein the power set contains all non-empty subsets of the second feature category set; Take the intersection of the power set with all the first feature category sets, and use each of the first feature category sets in the intersection as the third feature category set.
[0014] Compared with the prior art, the above embodiments have the following beneficial effects: by obtaining the power set of the second feature category set and performing an intersection operation with the first feature category set, all possible matching feature subset combinations are systematically screened out, thereby fully covering the range of available models under the current feature conditions; this method avoids the omission of the optimal feature combination, making the subsequent model selection more sufficient and accurate, thereby improving the overall classification effect.
[0015] Further, verifying the classification accuracy of each of the first classification models includes: Based on the third feature category set corresponding to the feature defect scenario for each of the first classification models, a corresponding validation set is generated based on the electrical equipment dataset; wherein, the features of the sample data in the validation set are the same as the features in the third feature category set; The classification accuracy of the first classification model is verified based on the validation set.
[0016] Compared with existing technologies, the above embodiments have the following beneficial effects: by constructing a validation set consistent with the feature category set for each classification model and verifying the classification accuracy, the performance evaluation of each model is targeted and comparable; selecting a model based on the validation results in real matching scenarios helps to improve the reliability of model selection, thereby ensuring that the final selected target classification model has better classification performance.
[0017] Furthermore, before training the classification model corresponding to several preset feature defect scenarios, the following steps are also included: The electrical equipment dataset is cleaned to remove outliers and duplicate samples, resulting in the first electrical equipment dataset. Discretize and map the non-numerical features in the first electrical equipment dataset, convert the non-numerical categories into numerical codes, and obtain the second electrical equipment dataset. The numerical features in the second electrical equipment dataset are normalized to eliminate the dimensional differences between different features, resulting in a third electrical equipment dataset for model training.
[0018] Compared with existing technologies, the above embodiments have the following beneficial effects: by performing data cleaning, discretization and normalization on the original electrical equipment dataset, abnormal data and redundant information can be effectively removed, and the expression forms and dimensions of different features can be unified, thereby improving data quality; this preprocessing process provides a high-quality data foundation for subsequent model training, which helps to improve the convergence effect and classification accuracy of the classification model.
[0019] Another embodiment of this application provides an electrical equipment classification device, including: a training module, a first identification module, a second identification module, and a third identification module; The training module is used to train several classification models corresponding to preset feature defect scenarios based on a preset electrical equipment dataset, and to verify the classification accuracy of each first classification model; wherein each feature defect scenario corresponds to a first feature category set. The first identification module is used to receive feature data corresponding to the electrical equipment to be identified, and to determine the second feature category set corresponding to the feature data; The second identification module is used to select a third feature category set that is a non-empty subset of the second feature category set from the first feature category set, and to use the classification model corresponding to each third feature category set as the first classification model; The third identification module is used to determine the target classification model with the highest classification accuracy from the first classification model, input the feature data into the target classification model, and obtain the classification result of the electrical equipment to be identified.
[0020] Another embodiment of this application provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps of the electrical equipment classification method of this application.
[0021] Another embodiment of this application also provides a computer-readable storage medium item, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to perform the steps of the electrical equipment classification method of this application. Attached Figure Description
[0022] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating the electrical equipment classification method provided in some embodiments of this application; Figure 2 This is a schematic diagram of the electrical equipment classification device provided in some embodiments of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0026] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0028] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0029] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0030] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0031] In current technologies for classifying electrical equipment, factors such as equipment malfunctions, communication anomalies, data loss, or limited sensing capabilities in different scenarios often lead to missing feature data, resulting in feature deficiencies. To address this common problem of missing feature information during data acquisition, existing technologies often employ mean interpolation to complete the data. However, this method generates interfering information that does not reflect reality, thus affecting the classification model's judgment and reducing the accuracy of electrical equipment classification.
[0032] Please refer to Figure 1 To address the problem of low accuracy in classifying electrical equipment in scenarios with missing features in the prior art, this application provides an electrical equipment classification method, including the following steps S101 to S104: S101: Based on a preset electrical equipment dataset, train a classification model corresponding to several preset feature defect scenarios; wherein, each feature defect scenario corresponds to a first feature category set.
[0033] In the implementation of this application, the construction of the electrical equipment dataset is the foundation for subsequent model training and classification. Specifically, firstly, based on the actual power system operating environment and multiple data acquisition methods such as smart homes and power load acquisition systems, a large amount of multi-dimensional feature information of electrical equipment is collected. This multi-dimensional feature information includes not only the basic electrical parameters of the equipment during operation (such as voltage, current, and power), but also higher-order signal features that reflect changes in the equipment's operating state (such as time-series waveform features and power change features), as well as behavioral features and physical environment features related to the equipment's usage scenario (such as usage time patterns, ambient temperature, or installation location). After acquiring the above multi-source feature data, the electrical equipment is classified according to its actual functional attributes and operating environment characteristics, forming a unified classification standard system.
[0034] In one specific implementation, electrical equipment can be categorized into eight types: kitchen cooking equipment, temperature control equipment, cleaning and bathroom equipment, office electronics, lighting equipment, home entertainment equipment, power and industrial equipment, and other tools. Subsequently, the collected multidimensional feature data of each type of equipment is associated with its corresponding equipment category label to construct a structured electrical equipment dataset. The dataset constructed in this way can fully represent the distribution differences of different categories of equipment in the multidimensional feature space, providing a reliable data foundation for subsequent training of Bayesian classification models based on kernel density estimation and for selecting the optimal feature combination in feature defect scenarios.
[0035] Furthermore, in some embodiments of this application, before training the classification model corresponding to several preset feature defect scenarios, the method further includes: The electrical equipment dataset is cleaned to remove outliers and duplicate samples, resulting in the first electrical equipment dataset. Discretize and map the non-numerical features in the first electrical equipment dataset, convert the non-numerical categories into numerical codes, and obtain the second electrical equipment dataset. The numerical features in the second electrical equipment dataset are normalized to eliminate the dimensional differences between different features, resulting in a third electrical equipment dataset for model training.
[0036] Before training a classification model for each characteristic defect scenario, it is necessary to first clean and preprocess the original electrical equipment dataset to ensure the data quality and consistency of subsequent model training.
[0037] Specifically, based on the constructed electrical equipment dataset containing multi-dimensional feature information, the data is cleaned to remove outlier samples generated during the collection process due to sensor malfunctions, communication errors, etc., as well as redundant samples with repeated records, thus obtaining the first electrical equipment dataset. Building on this, considering that the original data contains non-numerical features such as load type, equipment category labels, or operating status descriptions, these features need to be discretized and mapped. Different categorical features are converted into numerical forms according to preset encoding rules, enabling them to participate in subsequent probability modeling calculations, thus obtaining the second electrical equipment dataset.
[0038] Furthermore, addressing the significant differences in the units and ranges of different features within the second electrical equipment dataset, a normalization method is employed to linearly scale each numerical feature, uniformly mapping them to a preset interval (e.g., [0,1]). This eliminates the impact of unit differences on model training, ensuring the comparability of each feature's contribution to the model, thus yielding the third electrical equipment dataset for model training. This process not only improves the data's standardization and consistency but also provides a high-quality data input foundation for subsequent training of the Bayesian classification model based on kernel density estimation, which is beneficial for improving the model's convergence performance and classification accuracy.
[0039] This application effectively removes abnormal data and redundant information by cleaning, discretizing, and normalizing the original electrical equipment dataset, and unifies the expression forms and dimensions of different features, thereby improving data quality. This preprocessing provides a high-quality data foundation for subsequent model training, which helps to improve the convergence effect and classification accuracy of the classification model.
[0040] Furthermore, in some embodiments of this application, the step of training a classification model corresponding to several preset feature defect scenarios based on a preset electrical equipment dataset includes: Based on the first feature category set corresponding to each of the aforementioned feature defect scenarios, a corresponding training dataset is generated based on the electrical equipment dataset; wherein, the features of the sample data in the training dataset are the same as the features in the first feature category set; Based on each of the training datasets, a pre-defined Bayesian classification model based on kernel density is trained to obtain the classification model corresponding to each of the feature defect scenarios.
[0041] After obtaining the preprocessed electrical equipment dataset, corresponding classification models are pre-constructed for different feature loss scenarios. Specifically, the original feature set is first divided according to the possible feature defect scenarios, and the features obtainable under each feature defect scenario constitute the corresponding first feature category set. For example, in the case of partial sensor data loss or communication interruption, only the feature categories that can be stably obtained in the current scenario are retained. Based on this, for each feature defect scenario, data samples containing only the features in the first feature category set are selected from the electrical equipment dataset to generate a training dataset consistent with this feature subset, so that the sample feature categories in the training data completely match the available features in the corresponding scenario.
[0042] This application generates a matching training dataset for the first feature category set corresponding to each feature defect scenario, and trains the corresponding classification model respectively, so that each classification model is optimized under specific feature subset conditions, thereby enhancing the model's ability to adapt to feature missing situations. Furthermore, a Bayesian classification model based on kernel density is introduced, which can perform nonparametric estimation of probability density without relying on prior assumptions about feature distribution, improving the modeling ability under complex electricity consumption data distribution, thereby improving the accuracy of classification results.
[0043] Furthermore, in some embodiments of this application, the training of the preset kernel density-based Bayesian classification model includes: The prior probability of each equipment category is determined based on the proportion of samples of the equipment category in the training dataset. For each feature category in the training dataset, the probability density function of the feature category under each device category is fitted by the kernel density estimation method to obtain the conditional probability. Based on the prior probability and the conditional probability, the posterior probability is calculated based on Bayes' theorem to complete the training of the Bayesian classification model.
[0044] After obtaining the training datasets corresponding to each feature defect scenario, classification models are constructed based on each training dataset. In one specific implementation, a Bayesian classification method based on kernel density estimation is used for modeling: First, the prior probability of each category is calculated based on the proportion of samples of each device category in the training dataset; then, for each feature category, the probability distribution under different device categories is fitted using the kernel density estimation method to obtain the corresponding conditional probability distribution function, where the kernel function can be a Gaussian kernel function, and the smoothness of the distribution is adjusted by the window width parameter; based on this, the posterior probability of each category is calculated based on Bayes' theorem by combining the prior probability and the conditional probability, thereby completing the training of the classification model.
[0045] Specifically, in some embodiments of this application, prior probabilities The calculation formula is: ; in, For the k-th device category; Let be the number of training samples for the k-th device category. This represents the total number of samples in the training set.
[0046] Specifically, in some embodiments of this application, conditional probability The calculation formula is: ; in, For window width parameters, For Gaussian kernel function, Let j be the value of the j-th sample in the k-th device category in the i-th feature category. Let be the mean of the i-th feature category.
[0047] This application determines the prior probability by combining the sample proportion and uses the kernel density estimation method to obtain the conditional probability of each feature under different device categories. Then, it calculates the posterior probability based on Bayes' theorem to achieve refined training of the classification model. This method can make full use of the statistical characteristics of the data, improve the accuracy of probability estimation, and enable the model to still have strong discriminative ability when the features are fluctuating or incomplete, thereby further improving the reliability of the classification results.
[0048] By constructing a validation set consistent with the feature category set for each classification model and verifying its classification accuracy, the performance evaluation of each model becomes targeted and comparable. Selecting a model based on the validation results in real matching scenarios helps improve the reliability of model selection, thereby ensuring that the final selected target classification model has better classification performance.
[0049] S102: Receive feature data corresponding to the electrical equipment to be identified, and determine the second feature category set corresponding to the feature data.
[0050] S103: Select a third feature category set from the first feature category set that is a non-empty subset of the second feature category set, and use the classification model corresponding to each third feature category set as a first classification model, and verify the classification accuracy of each first classification model.
[0051] Furthermore, in some embodiments of this application, the step of selecting a third feature category set from the first feature category set as a non-empty subset of the second feature category set includes: Obtain the power set of the second feature category set, wherein the power set contains all non-empty subsets of the second feature category set; Take the intersection of the power set with all the first feature category sets, and use each of the first feature category sets in the intersection as the third feature category set.
[0052] After determining the second feature category set corresponding to the electrical equipment to be identified, it is necessary to select candidate feature combinations that match the current feature conditions from the constructed feature defect scenarios. Specifically, firstly, the second feature category set is subjected to subset expansion to obtain its power set, and the empty set is removed to obtain all possible non-empty feature subsets, representing the values of the currently known features under different combinations. Subsequently, each non-empty subset in the power set is matched with the predefined first feature category set corresponding to each feature defect scenario, that is, it is determined one by one whether each subset is a subset of a certain first feature category set or has the same feature category structure as it; for the first feature category set that satisfies the matching relationship, it is extracted as a candidate feature set. In other words, by performing an intersection operation on the power set and all first feature category sets, feature combinations that simultaneously belong to the range of currently known features and have been covered in the model training phase are selected, and these matched first feature category sets are used as the third feature category set. This process ensures that the selected feature combination not only matches the actual characteristics of the current device, but also corresponds to the existing classification model, providing a basis for selecting the optimal classification model from multiple candidate models and avoiding model failure or decreased classification accuracy due to feature mismatch.
[0053] Furthermore, in some embodiments of this application, verifying the classification accuracy of each of the first classification models includes: Based on the third feature category set corresponding to the feature defect scenario for each of the first classification models, a corresponding validation set is generated based on the electrical equipment dataset; wherein, the features of the sample data in the validation set are the same as the features in the third feature category set; The classification accuracy of the first classification model is verified based on the validation set.
[0054] After selecting the first classification model, to objectively evaluate the performance of different models in their respective applicable scenarios, it is necessary to verify the classification accuracy of each first classification model. Specifically, for the feature defect scenario corresponding to each first classification model, based on the third feature category set corresponding to that scenario, data samples consistent with the feature set are selected from the electrical equipment dataset to construct a validation set. That is, only the feature categories contained in the third feature category set are retained, so that the sample features in the validation set are consistent with the input features of the corresponding model. At the same time, when constructing the validation set, the original dataset can be divided into a training set and a validation set according to a preset ratio, or cross-validation can be used to improve the stability of the evaluation results. After obtaining the validation set corresponding to each classification model, the sample data in the validation set is input into the corresponding classification model. Based on the probability results of each equipment category output by the model, the category with the highest probability is selected as the prediction result, and the prediction result is compared with the true category label of the sample to calculate the classification accuracy. In a specific implementation, the ratio of the number of correctly classified samples to the total number of samples in the validation set can be used as the accuracy evaluation index to reflect the classification performance of the model under the current feature subset or feature defect scenario. Through the above verification process, the performance indicators of each classification model under the corresponding feature conditions can be obtained, which provides a basis for selecting the target classification model with the highest classification accuracy from multiple candidate models. This ensures that the optimal model can still be selected for classification even when there are missing features, thereby improving the accuracy and reliability of the overall classification results.
[0055] This application systematically filters out all possible matching feature subset combinations by obtaining the power set of the second feature category set and performing an intersection operation with the first feature category set, thereby comprehensively covering the range of available models under the current feature conditions. This approach avoids missing the optimal feature combination, making subsequent model selection more sufficient and accurate, thereby improving the overall classification effect.
[0056] S104: Determine the target classification model with the highest classification accuracy from the first classification model, input the feature data into the target classification model, and obtain the classification result of the electrical equipment to be identified.
[0057] Furthermore, in some embodiments of this application, the step of inputting the feature data into the target classification model to obtain the classification result of the electrical equipment to be identified includes: Based on the third feature category set of the target classification model, corresponding input data is extracted from the feature data; wherein the features of the input data are the same as the features of the third feature category set. The input data is input into the target classification model to obtain the probability that the electrical equipment to be identified belongs to each of the equipment categories; The device category with the highest probability is selected as the classification result of the electrical device to be identified.
[0058] After determining the target classification model, the feature data of the electrical equipment to be identified is matched based on the third feature category set corresponding to the model to construct a data format that meets the model input requirements. Specifically, according to the feature categories included in the third feature category set, corresponding feature components are extracted from the original feature data of the electrical equipment to be identified to form an input data vector. This ensures that the feature categories and arrangement of the input data are consistent with the feature set used during the training of the target classification model, thereby guaranteeing that the model input matches the training conditions. Based on this, the input data is input into a pre-trained Bayesian classification model based on kernel density estimation. Using the prior probabilities determined in the model and the conditional probability density functions of each feature under different equipment categories, probability inference is performed on the input data to calculate the posterior probability distribution of the electrical equipment to be identified belonging to each candidate equipment category. Further, the above posterior probability results are compared, and the equipment category with the highest probability value is selected as the final classification result output.
[0059] In one specific implementation, the probability values corresponding to each category can be output simultaneously, or a confusion matrix can be constructed to characterize the classification performance, thereby enabling an intuitive evaluation of the classification results. Through this method, the classification of electrical equipment can be completed using only currently known features, avoiding unnecessary completion errors introduced due to missing features, thus improving the accuracy and stability of the classification results.
[0060] This application avoids interference from irrelevant or missing features in the classification process by extracting only input data that matches the third feature category set corresponding to the target classification model, and determines the device category through probability output, so that the classification result has a clear confidence basis; this method improves the matching degree between model input and model structure, thereby improving the stability and accuracy of the classification process.
[0061] In summary, the electrical equipment classification method provided in this application has the following advantages compared to existing technologies: Addressing the technical problem that existing technologies rely on mean interpolation and other methods to complete data in scenarios with missing features, introducing distorted information and thus reducing classification accuracy, this application pre-trains corresponding classification models for different feature defect scenarios. During the identification stage, based on the actual feature category set of the electrical equipment to be identified, it selects the target classification model from multiple candidate models that matches the current feature conditions and has the highest classification accuracy for classification processing. Since this application does not manually complete missing features but directly selects the appropriate model based on existing effective features, it avoids noise interference caused by interpolation completion. Simultaneously, by constructing multiple models for different feature subsets and optimizing them based on accuracy, the model can better adapt to changes in feature categories, improving robustness and adaptability in feature defect scenarios. Based on the above technical means, this application can maintain high classification accuracy even with incomplete feature information, thereby significantly improving the accuracy and reliability of electrical equipment classification.
[0062] like Figure 2 As shown, based on the above-described method embodiments, an embodiment of this application provides an electrical equipment classification device, including: a training module 201, a first identification module 202, a second identification module 203, and a third identification module 204; The training module 201 is used to train a number of classification models corresponding to preset feature defect scenarios based on a preset electrical equipment dataset; wherein each feature defect scenario corresponds to a first feature category set. The first identification module 202 is used to receive feature data corresponding to the electrical equipment to be identified and determine the second feature category set corresponding to the feature data; The second identification module 203 is used to select a third feature category set that is a non-empty subset of the second feature category set from the first feature category set, and to use the classification model corresponding to each third feature category set as a first classification model, and to verify the classification accuracy of each first classification model; The third identification module 204 is used to determine the target classification model with the highest classification accuracy from the first classification model, input the feature data into the target classification model, and obtain the classification result of the electrical equipment to be identified.
[0063] Further, in some embodiments of this application, the training module 201 includes: a first construction unit and a training unit; the training module 201 is used to train a classification model corresponding to several preset feature defect scenarios based on a preset electrical equipment dataset, including: The first construction unit is configured to generate a corresponding training dataset based on the electrical equipment dataset according to the first feature category set corresponding to each of the aforementioned feature defect scenarios; wherein the features of the sample data in the training dataset are the same as the features in the first feature category set. The training unit is used to train a preset Bayesian classification model based on kernel density based on each of the training datasets, so as to obtain the classification model corresponding to each of the feature defect scenarios.
[0064] Furthermore, in some embodiments of this application, the training unit, used to train a preset Bayesian classification model based on kernel density, includes: The prior probability of each equipment category is determined based on the proportion of samples of the equipment category in the training dataset. For each feature category in the training dataset, the probability density function of the feature category under each device category is fitted by the kernel density estimation method to obtain the conditional probability. Based on the prior probability and the conditional probability, the posterior probability is calculated based on Bayes' theorem to complete the training of the Bayesian classification model.
[0065] Further, in some embodiments of this application, the third identification module 204 includes: an extraction unit, an input unit, and a selection unit; the third identification module 204 is used to input the feature data into the target classification model to obtain the classification result of the electrical equipment to be identified, including: The extraction unit is used to extract corresponding input data from the feature data according to the third feature category set of the target classification model; wherein the features of the input data are the same as the features of the third feature category set. The input unit is used to input the input data into the target classification model to obtain the probability that the electrical equipment to be identified belongs to each of the equipment categories; The selection unit is used to select the device category with the highest probability as the classification result of the electrical device to be identified.
[0066] Further, in some embodiments of this application, the second identification module 203 includes: a second construction unit and an intersection unit; the second identification module 203 is used to select a third feature category set that is a non-empty subset of the second feature category set from the first feature category set, including: The second construction unit is used to obtain the power set of the second feature category set, wherein the power set contains all non-empty subsets of the second feature category set; The intersection unit is used to take the intersection of the power set and all the first feature category sets, and to take each of the first feature category sets in the intersection as the third feature category set.
[0067] Further, in some embodiments of this application, the training module 201 includes: a third construction unit and a verification unit; the training module 201 is used to verify the classification accuracy of each of the first classification models, including: The third construction unit is used to generate a corresponding validation set based on the electrical equipment dataset according to the third feature category set corresponding to the feature defect scenario of each of the first classification models; wherein the features of the sample data in the validation set are the same as the features in the third feature category set. The verification unit is used to verify the classification accuracy corresponding to the first classification model based on the verification set.
[0068] Furthermore, in some embodiments of this application, before training the classification model corresponding to several preset feature defect scenarios, the method further includes: The electrical equipment dataset is cleaned to remove outliers and duplicate samples, resulting in the first electrical equipment dataset. Discretize and map the non-numerical features in the first electrical equipment dataset, convert the non-numerical categories into numerical codes, and obtain the second electrical equipment dataset. The numerical features in the second electrical equipment dataset are normalized to eliminate the dimensional differences between different features, resulting in a third electrical equipment dataset for model training.
[0069] In summary, the electrical equipment classification device provided in this application has the following advantages compared to the prior art: Addressing the technical problem that existing technologies rely on mean interpolation and other methods to complete data in scenarios with missing features, leading to distorted information and reduced classification accuracy, this application pre-trains corresponding classification models for different feature defect scenarios. During the identification stage, based on the actual feature category set of the electrical equipment to be identified, it selects the target classification model from multiple candidate models that matches the current feature conditions and has the highest classification accuracy for classification processing. Since this application does not manually complete missing features but directly selects the appropriate model based on existing effective features, it avoids noise interference caused by interpolation completion. Simultaneously, by constructing multiple models for different feature subsets and optimizing them based on accuracy, the model can better adapt to changes in feature categories, improving robustness and adaptability in feature defect scenarios. Based on the above technical means, this application can maintain high classification accuracy even with incomplete feature information, thereby significantly improving the accuracy and reliability of electrical equipment classification.
[0070] It is understood that the above-described device embodiments correspond to the method embodiments of this application, and can implement the electrical equipment classification method provided by any of the above-described method embodiments of this application.
[0071] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided in this application, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0072] Based on the above embodiments of the electrical equipment classification method, another embodiment of this application provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the electrical equipment classification method of any embodiment of this application.
[0073] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete this application. The one or more module units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0074] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0075] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0076] Based on the above-described method embodiments, another embodiment of this application provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the electrical equipment classification method described in any of the above-described method embodiments of this application.
[0077] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
Claims
1. A method for classifying electrical equipment, characterized in that, include: Based on a pre-set dataset of electrical equipment, several classification models corresponding to pre-set characteristic defect scenarios are trained; wherein each characteristic defect scenario corresponds to a first set of characteristic categories. Receive feature data corresponding to the electrical equipment to be identified, and determine the second feature category set corresponding to the feature data; Select a third feature category set that is a non-empty subset of the second feature category set from the first feature category set, and use the classification model corresponding to each third feature category set as the first classification model, and verify the classification accuracy of each first classification model; The target classification model with the highest classification accuracy is determined from the first classification model, and the feature data is input into the target classification model to obtain the classification result of the electrical equipment to be identified.
2. The method for classifying electrical equipment as described in claim 1, characterized in that, The step of training several classification models corresponding to preset feature defect scenarios based on a preset electrical equipment dataset includes: Based on the first feature category set corresponding to each of the aforementioned feature defect scenarios, a corresponding training dataset is generated based on the electrical equipment dataset; wherein, the features of the sample data in the training dataset are the same as the features in the first feature category set; Based on each of the training datasets, a pre-defined Bayesian classification model based on kernel density is trained to obtain the classification model corresponding to each of the feature defect scenarios.
3. The method for classifying electrical equipment as described in claim 2, characterized in that, The pre-set Bayesian classification model based on kernel density includes: The prior probability of each equipment category is determined based on the proportion of samples of the equipment category in the training dataset. For each feature category in the training dataset, the probability density function of the feature category under each device category is fitted by the kernel density estimation method to obtain the conditional probability. Based on the prior probability and the conditional probability, the posterior probability is calculated based on Bayes' theorem to complete the training of the Bayesian classification model.
4. The method for classifying electrical equipment as described in claim 3, characterized in that, The step of inputting the feature data into the target classification model to obtain the classification result of the electrical equipment to be identified includes: Based on the third feature category set of the target classification model, corresponding input data is extracted from the feature data; wherein the features of the input data are the same as the features of the third feature category set. The input data is input into the target classification model to obtain the probability that the electrical equipment to be identified belongs to each of the equipment categories; The device category with the highest probability is selected as the classification result of the electrical device to be identified.
5. The method for classifying electrical equipment as described in claim 1, characterized in that, The third feature category set selected from the first feature category set as a non-empty subset of the second feature category set includes: Obtain the power set of the second feature category set, wherein the power set contains all non-empty subsets of the second feature category set; Take the intersection of the power set with all the first feature category sets, and use each of the first feature category sets in the intersection as the third feature category set.
6. The method for classifying electrical equipment as described in claim 1, characterized in that, The verification of the classification accuracy of each of the first classification models includes: Based on the third feature category set corresponding to the feature defect scenario for each of the first classification models, a corresponding validation set is generated based on the electrical equipment dataset; wherein, the features of the sample data in the validation set are the same as the features in the third feature category set; The classification accuracy of the first classification model is verified based on the validation set.
7. The method for classifying electrical equipment as described in claim 1, characterized in that, Before training the classification model corresponding to several preset feature defect scenarios, the following steps are also included: The electrical equipment dataset is cleaned to remove outliers and duplicate samples, resulting in the first electrical equipment dataset. Discretize and map the non-numerical features in the first electrical equipment dataset, convert the non-numerical categories into numerical codes, and obtain the second electrical equipment dataset. The numerical features in the second electrical equipment dataset are normalized to eliminate the dimensional differences between different features, resulting in a third electrical equipment dataset for model training.
8. A device for classifying electrical equipment, characterized in that, include: The system comprises a training module, a first recognition module, a second recognition module, and a third recognition module. The training module is used to train a classification model corresponding to several preset feature defect scenarios based on a preset electrical equipment dataset; wherein each feature defect scenario corresponds to a first feature category set. The first identification module is used to receive feature data corresponding to the electrical equipment to be identified and to determine the second feature category set corresponding to the feature data; The second identification module is used to select a third feature category set that is a non-empty subset of the second feature category set from the first feature category set, and to use the classification model corresponding to each third feature category set as a first classification model, and to verify the classification accuracy of each first classification model; The third identification module is used to determine the target classification model with the highest classification accuracy from the first classification model, input the feature data into the target classification model, and obtain the classification result of the electrical equipment to be identified.
9. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement a method for classifying electrical equipment as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform an electrical equipment classification method as described in any one of claims 1 to 7.