A floor flatness detection method and system
By screening and constructing an ensemble classifier, the problem of duplicate or similar base classifiers in the AdaBoost algorithm is solved, which improves the accuracy and precision of water-based epoxy flooring flatness detection and ensures the reliability of the detection results.
Patent Information
- Application Number
- CN202511211327.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-08-28
AI Technical Summary
In existing technologies, the classification results of the base classifiers in the AdaBoost algorithm for detecting the flatness of water-based epoxy flooring are repetitive or similar, making it difficult for the ensemble classifier to achieve high recognition accuracy and affecting the accuracy of the detection results.
By screening base classifiers, the target category and its corresponding standard and the first base classifier to be analyzed are determined. The base classifiers to be integrated are selected based on the classification repetition. The integrated classifier is constructed, and the feature vector matching pairs are used for screening to remove duplicate or similar base classifiers.
This improves the accuracy and precision of floor flatness testing, ensuring that the integrated classifier can effectively distinguish samples of different flatness levels and guaranteeing the reliability of the test results.
Smart Images

Figure CN120724265B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of surface roughness testing technology, specifically to a method and system for testing the flatness of a floor. Background Technology
[0002] Currently, when testing the flatness of water-based epoxy flooring, the AdaBoost (Adaptive Boosting) algorithm can be used to train a classifier, and then the flatness level can be obtained based on the classifier. Based on the flatness level, it can be determined whether the water-based epoxy flooring meets the requirements.
[0003] However, in existing technologies, the base classifiers obtained by the AdaBoost algorithm are often weighted based on the misclassification rate of each base classifier, and then an ensemble classifier is constructed. However, for the base classifiers, there may be multiple base classifiers with overlapping or similar classification results, making it difficult for the trained ensemble classifier to converge to a high recognition accuracy, ultimately affecting the accuracy of the flatness detection results for water-based epoxy flooring. Summary of the Invention
[0004] The purpose of this invention is to provide a method and system for detecting the flatness of a floor, in order to solve the problem of low accuracy in existing floor flatness detection methods.
[0005] To solve the above-mentioned technical problems, the present invention provides a method for detecting the flatness of a floor, comprising the following steps:
[0006] Obtain a sample set, wherein each sample in the sample set is a flatness vector corresponding to each floor surface, and each flatness vector corresponds to a flatness level;
[0007] All samples in the sample set are classified to obtain various categories, each category corresponding to a flatness level. Based on the misclassification rate of each base classifier for each category, the target category in each category and the first base classifier corresponding to each target category are determined.
[0008] Based on the misclassification rate of each target category by its corresponding first base classifier, determine the standard first base classifier and the first base classifier to be analyzed among the first base classifiers corresponding to each target category;
[0009] Based on the misclassification rate and samples of each target category being misclassified into each category by its corresponding first base classifier, the category samples of each target category corresponding to each first base classifier are determined, and based on the difference between the category samples of each target category corresponding to each first base classifier to be analyzed and the standard first base classifier, the classification repetition degree corresponding to each first base classifier to be analyzed is determined.
[0010] Based on the classification repetition, the base classifiers are screened to obtain each base classifier to be integrated. All the base classifiers to be integrated are then integrated to obtain an integrated classifier, which is then used to detect the flatness of the ground.
[0011] Further, determining the target category in each category and the first base classifier corresponding to each target category includes:
[0012] The misclassification rate of each base classifier for each category is compared with the misclassification rate threshold. Categories with misclassification rates greater than the misclassification rate threshold are identified as the misclassified categories corresponding to the base classifier.
[0013] The category corresponding to the maximum misclassification rate among the misclassification rates of each base classifier for each category is determined. If the category corresponding to the maximum misclassification rate belongs to the misclassifiable category of the corresponding base classifier, then the category corresponding to the maximum misclassification rate is determined as a target category, and the corresponding base classifier is determined as a first base classifier of the target category.
[0014] Further, determining the standard first base classifier and the first base classifier to be analyzed in the first base classifier corresponding to each target category includes:
[0015] Determine the maximum and second-maximum misclassification rates among the misclassification rates of each target category by its corresponding first base classifier for each category;
[0016] Based on the difference between the maximum misclassification rate and the second-maximum misclassification rate of each target category when it is misclassified by each of the first base classifiers, the salience of the maximum misclassification rate of each target category when it is misclassified by each of the first base classifiers is determined.
[0017] The maximum salience among the saliences of the maximum misclassification rates of all the first base classifiers corresponding to each target category is determined, and the first base classifier corresponding to the maximum salience is used as the standard first base classifier for the target category, while the other first base classifiers are used as the first base classifiers to be analyzed for the target category.
[0018] Furthermore, the salience of the maximum misclassification rate when each target category is misclassified by its corresponding first base classifier is determined, and the corresponding calculation formula is as follows:
[0019] ;
[0020] in, This indicates that target category a is associated with its corresponding first category. The prominence of the maximum misclassification rate when the first base classifier misclassifies; This indicates that target category a is associated with its corresponding first category. The maximum misclassification rate of the first base classifier in each category; This indicates that target category a is associated with its corresponding first category. The second-largest misclassification rate of the first base classifier for each category.
[0021] Further, determining the category samples corresponding to each of the target categories for each of the first base classifiers includes:
[0022] The first class sample corresponding to each first base classifier of each target class is determined by all misclassified samples in the class corresponding to the largest misclassification rate among the misclassification rates of each target class being misclassified into each class by each of the first base classifiers.
[0023] For each target category, all misclassified samples other than the first category samples are determined by each of its corresponding first base classifiers, and these are identified as the second category samples corresponding to each target category and its first base classifier.
[0024] For each target category, the first category sample and the second category sample of each of its first base classifiers are determined to be the category sample of each target category corresponding to each of its first base classifiers.
[0025] Further, determining the classification redundancy of each of the first base classifiers to be analyzed includes:
[0026] Based on the first category samples corresponding to each of the target categories and each of the first base classifiers, determine the feature vector and its feature value of the first category samples corresponding to each of the target categories and each of the first base classifiers; and based on the second category samples corresponding to each of the target categories and each of the first base classifiers, determine the feature vector and its feature value of the second category samples corresponding to each of the target categories and each of the first base classifiers.
[0027] For each target category, the feature vector of the first category sample corresponding to each first base classifier is matched with the feature vector of the corresponding second category sample to obtain the feature vector matching pair of each target category corresponding to each first base classifier.
[0028] Filter the feature vector matching pairs corresponding to the standard first base classifier for each target category to determine the target feature vector matching pairs corresponding to the standard first base classifier for each target category;
[0029] Based on the similarity between the feature vector matching pairs of each target category corresponding to each of its first base classifiers to be analyzed and the target feature vector matching pairs of each target category corresponding to its standard first base classifier, and combined with the feature values of each feature vector in the feature vector matching pairs of each target category corresponding to each of its first base classifiers to be analyzed, the feature value of each target category corresponding to each of its first base classifiers to be analyzed is determined to be larger.
[0030] Based on the maximum feature value of each target category corresponding to each of the first base classifiers to be analyzed, the cumulative value of the maximum feature value of each of the first base classifiers to be analyzed for each target category is determined, and the classification repetition degree corresponding to each of the first base classifiers to be analyzed is obtained.
[0031] Further, determining the maximality of feature values for each target category corresponding to each of the first base classifiers to be analyzed includes:
[0032] Determine the mean of the two feature vectors in the feature vector matching pair corresponding to each target category for each of the first base classifiers to be analyzed, and obtain the mean feature vector of each feature vector matching pair;
[0033] The mean of all feature vectors in all target feature vector matching pairs corresponding to each target category and its standard first base classifier is determined to obtain the benchmark mean feature vector;
[0034] Calculate the cosine similarity between the mean feature vector of each feature vector matching pair and the benchmark mean feature vector, and denote the mean feature vector corresponding to the maximum cosine similarity as the corresponding vector;
[0035] The maximum and second maximum eigenvalues among all feature values corresponding to all feature vectors in all feature vector matching pairs for each target category and each of the first base classifiers to be analyzed are determined, and the salience of the maximum eigenvalue for each target category and each of the first base classifiers to be analyzed is determined based on the maximum and second maximum eigenvalues.
[0036] The average feature value is obtained by determining the average feature value of the two feature vectors corresponding to the corresponding vector of each target category and each of the first base classifiers to be analyzed; the ratio of the average feature value to the maximum feature value is determined to obtain the feature value ratio.
[0037] Based on the maximum salience and eigenvalue ratio of each target category for each of its first base classifiers to be analyzed, the eigenvalue maximization of each target category for each of its first base classifiers to be analyzed is determined, wherein the maximum eigenvalue salience and eigenvalue ratio are both positively correlated with the eigenvalue maximization.
[0038] Further, determining the maximality of feature values for each target category corresponding to each of the first base classifiers to be analyzed includes:
[0039] The product of the maximum salience of the feature value and the feature value ratio of each target category corresponding to each of the first base classifiers to be analyzed is determined as the feature value maximization of each target category corresponding to each of the first base classifiers to be analyzed.
[0040] Furthermore, the base classifiers are screened to obtain the various base classifiers to be integrated, including:
[0041] Remove the set number of base classifiers with the highest classification repetition, and use all remaining base classifiers as base classifiers to be integrated.
[0042] To address the aforementioned technical problems, the present invention also provides a floor flatness detection system, comprising a processor and a memory, wherein the processor is used to process computer program code stored in the memory to implement the steps of a floor flatness detection method as described in any of the preceding claims.
[0043] This invention offers the following advantages: First, based on the misclassification rate of each base classifier for each category, the target category within each category is determined. The target category refers to the misclassified category that is difficult to distinguish. Simultaneously, multiple first base classifiers that are difficult to distinguish these target categories are identified. Next, based on the distribution of the misclassification rates of each target category by its corresponding first base classifier, the standard first base classifier with high misclassification purity for that target category and the first base classifiers to be analyzed with relatively low misclassification purity for that target category are determined. By analyzing the differences between the category samples misclassified by the standard first base classifier and the category samples misclassified by each of the first base classifiers to be analyzed for each target category, the classification redundancy of each first base classifier to be analyzed is determined. Based on this classification redundancy, the base classifiers are screened, removing those with redundancy or similar classification effects to other base classifiers, thereby obtaining each base classifier to be integrated, and then integrating them to obtain the ensemble classifier. Since this ensemble classifier is composed of multiple base classifiers with different classification effects, these base classifiers can effectively distinguish samples of different flatness levels. When using this ensemble classifier to detect the flatness of a new floor, the accuracy of the flatness detection can be effectively guaranteed. Attached Figure Description
[0044] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a flowchart of the method for detecting the flatness of a floor according to an embodiment of the present invention;
[0046] Figure 2 This is a flowchart illustrating the determination of the target category and its corresponding first base classifier according to an embodiment of the present invention;
[0047] Figure 3 This is a flowchart illustrating the standard first base classifier and the first base classifier to be analyzed for each target category in an embodiment of the present invention.
[0048] Figure 4 This is a flowchart illustrating how to determine the category samples of each target category corresponding to each first base classifier in an embodiment of the present invention;
[0049] Figure 5 This is a flowchart illustrating the process of determining the classification repetition rate corresponding to each first base classifier to be analyzed, as described in this embodiment of the invention.
[0050] Figure 6 This is a flowchart illustrating the determination of the maximum feature value of each target category corresponding to each first base classifier to be analyzed, according to an embodiment of the present invention. Detailed Implementation
[0051] To further illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the specific implementation methods, structures, features, and effects of the technical solution proposed according to the present invention are described in detail below with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0052] 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 invention pertains. Furthermore, all parameters or indices in the formulas discussed herein are normalized values to eliminate the influence of dimensions.
[0053] Method Implementation Examples:
[0054] To address the inaccuracy of existing flatness testing methods, this embodiment provides a method for detecting floor flatness. The flowchart of this method is as follows: Figure 1As shown, the specific steps include the following:
[0055] Step S1: Obtain a sample set, where each sample in the sample set is a flatness vector corresponding to each floor surface, and each flatness vector corresponds to a flatness level.
[0056] Laser sensors are used to detect the flatness of different floor surfaces, resulting in measurement data for each surface. This measurement data refers to the height sequence obtained by the laser sensors. The floor surface type can be water-based epoxy flooring. Features are extracted from the measurement data, including variance, standard deviation of elevation difference, and local unevenness. Among them, variance refers to the variance of all height elements in the height sequence; standard deviation of elevation difference is a statistical measure reflecting the change in elevation of the ground surface. It is obtained by calculating the elevation difference between every two adjacent height elements in the height sequence, squaring all elevation differences, and then calculating the square root of the average of all squared elevation differences in the height difference sequence to obtain the standard deviation of elevation difference; local unevenness is a feature describing the degree of local undulation of the ground surface. It can be determined by calculating the difference between the maximum and minimum elevation in a local area. Specifically, a fixed-size window is selected, and the window is moved along the height sequence. The difference between the maximum and minimum elevation in each window is calculated. Based on the difference between the maximum and minimum elevation in all windows, the local unevenness is evaluated by setting a threshold or statistical analysis. The specific evaluation method is existing technology and will not be elaborated here.
[0057] A flatness vector is constructed using features extracted from the measurement data of each floor slab, thus obtaining the flatness vector corresponding to each floor slab. A label is assigned to the flatness vector corresponding to each floor slab; this label represents a flatness level, and thus one flatness vector corresponds to one flatness level. In this embodiment of the invention, the flatness levels are sequentially: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, and 1, with higher levels indicating greater flatness.
[0058] To facilitate the subsequent training of the ensemble classifier in the AdaBoost algorithm and thus achieve accurate detection of the flatness level of the ground, each flatness vector determined above is taken as a sample, and all samples constitute a sample set, thereby completing the construction of the sample set.
[0059] Step S2: Classify all samples in the sample set to obtain each category. Each category corresponds to a flatness level. Based on the misclassification rate of each base classifier for each category, determine the target category in each category and the first base classifier corresponding to each target category.
[0060] To address the problem that traditional AdaBoost algorithms struggle to achieve high accuracy in smoothness level detection due to overlapping or similar classification results among base classifiers, this invention filters out base classifiers with repetitive or similar results, ensuring that each classifier performs differently. For example, base classifier A can effectively distinguish between smoothness levels of 0.1 and 0.2, while base classifier B can effectively distinguish between smoothness levels of 0.3 and 0.4. This results in a higher accuracy for the final ensemble classifier.
[0061] To achieve the above objectives, samples of the same flatness level are first divided into a category, thus obtaining various categories. The categories that are difficult to distinguish within each category are identified as the target categories, along with multiple first base classifiers that are difficult to differentiate between these target categories. Then, the standard first base classifier with high misclassification purity for each target category and the first base classifier to be analyzed with relatively low misclassification purity for that target category are calculated. Based on the differences between the category samples misclassified by the standard first base classifier and the category samples misclassified by each of the first base classifiers to be analyzed for each target category, the classification repeatability corresponding to each first base classifier to be analyzed is calculated. Based on this classification repeatability, the base classifiers are screened to avoid overfitting and other problems caused by the repeatability of the base classifier's classification effect, thereby improving the accuracy and precision of the floor flatness detection.
[0062] Specifically, in the AdaBoost algorithm, if the current number of base classifiers reaches a first predetermined number, where the base classifiers are SVM classifiers, then these base classifiers need to be filtered to obtain a second predetermined number of retained base classifiers. These retained base classifiers are then ensembled to form the final ensemble classifier. The values of the first and second predetermined numbers can be reasonably selected as needed. In this embodiment, the first predetermined number is set to 20, and the second predetermined number is set to 15.
[0063] To filter base classifiers, for any one of the predetermined number of base classifiers, the misclassification rate for each category is determined. Samples with the same smoothness level constitute a category. Taking any category b as an example, all samples of category b are input into the base classifier, which outputs the smoothness level corresponding to each sample in category b. The output smoothness level of each sample in category b is compared with the corresponding label smoothness level. When the output smoothness level does not match the corresponding label smoothness level, the corresponding sample is determined to be a misclassified sample. The ratio of the number of misclassified samples in category b to the total number of samples in category b is recorded as the misclassification rate of category b, thus obtaining the misclassification rate of the base classifier for category b. In this way, the misclassification rate of each base classifier for each category can be determined.
[0064] refer to Figure 2 By analyzing the misclassification rate of each base classifier for each category, the target category in each category and the first base classifier corresponding to each target category can be determined. The implementation steps include:
[0065] Step S201: Compare the misclassification rate of each base classifier for each category with the misclassification rate threshold, and determine the category with the misclassification rate greater than the misclassification rate threshold as the misclassified category corresponding to the base classifier.
[0066] Step S202: Determine the category corresponding to the maximum misclassification rate among the misclassification rates of each base classifier for each category. If the category corresponding to the maximum misclassification rate belongs to the misclassifiable category corresponding to the base classifier, then the category corresponding to the maximum misclassification rate is determined as a target category, and the corresponding base classifier is determined as a first base classifier of the target category.
[0067] Specifically, a misclassification rate threshold is preset. The value of this threshold can be reasonably selected as needed. In this embodiment of the invention, the misclassification rate threshold is set to 0.3. The misclassification rate of each base classifier for each category is compared with the misclassification rate threshold. Categories with misclassification rates greater than the threshold are recorded as misclassifiable categories, thereby determining the misclassifiable categories corresponding to each base classifier.
[0068] For any one of the first predetermined number of base classifiers, based on the misclassification rate of that base classifier for each category, the category corresponding to the largest misclassification rate is determined. If the category corresponding to the largest misclassification rate belongs to the misclassifiable category of that base classifier, then that category is recorded as the target category, and the base classifier is recorded as the first base classifier of that target category. In this way, the first base classifier for each target category can be determined, and there may be multiple first base classifiers for each target category. If the misclassification rate of a target category by its corresponding first base classifier is relatively high compared to other categories, and the misclassification rate of the target category by its corresponding first base classifier exceeds a certain level, then the target category can also be understood as a misclassifiable category that is difficult to distinguish. It should be understood that since some categories may have a small misclassification rate in each base classifier, the target category here may be a subset of all categories.
[0069] Step S3: Based on the misclassification rate of each target category by its corresponding first base classifier, determine the standard first base classifier and the first base classifier to be analyzed among the first base classifiers corresponding to each target category.
[0070] Since the first base classifier for each target category refers to the base classifier that is prone to misclassification of that target category, the target category may be misclassified into multiple categories. We find the salience of the maximum misclassification rate of each target category by each first base classifier. Based on the salience of this maximum misclassification rate, we then find the corresponding first base classifier as the standard first base classifier. If, when the target category is misclassified into other categories, the feature vectors obtained by other first base classifiers are similar to those obtained by the standard first base classifier, it indicates that there are likely base classifiers with high information redundancy, and these need to be filtered.
[0071] refer to Figure 3 By analyzing the misclassification rate of each target category by its corresponding first base classifier, the standard first base classifier and the first base classifier to be analyzed in the first base classifier corresponding to each target category can be determined. The implementation steps include:
[0072] Step S301: Determine the maximum and second maximum misclassification rates among the misclassification rates of each target category by its corresponding first base classifier for each category;
[0073] Step S302: Based on the difference between the maximum misclassification rate and the second maximum misclassification rate when each target category is misclassified by each of its corresponding first base classifiers, determine the salience of the maximum misclassification rate when each target category is misclassified by each of its corresponding first base classifiers;
[0074] Step S303: Determine the maximum salience among the saliences of the maximum misclassification rates of all the first base classifiers for each target category, and use the first base classifier corresponding to the maximum salience as the standard first base classifier for the target category, and use the other first base classifiers as the first base classifiers to be analyzed for the target category.
[0075] Specifically, taking any target category 'a' as an example, for any first base classifier of target category 'a', we can obtain the multiple categories in which target category 'a' is misclassified, and the misclassification rate of target category 'a' being misclassified into each category. The sequence formed by arranging these misclassification rates in descending order is denoted as the misclassification rate sequence, thus obtaining the misclassification rate sequence of target category 'a' corresponding to the first base classifier. For ease of understanding, for example, let's denot the two first base classifiers of target category 'a' as E and F. If E misclassifies target category 'a' into categories a1, a2, a3, and a4 with probabilities of 2%, 10%, 15%, and 10%, respectively, then the misclassification rate sequence of target category 'a' corresponding to the first base classifier E is {15% 10% 10% 2%}; and if F misclassifies target category 'a' into categories a1, a2, and a3 with probabilities of 3%, 5%, and 10%, then the misclassification rate sequence of target category 'a' corresponding to the first base classifier F is {10% 5% 3%}.
[0076] After determining the misclassification rate sequence for each first base classifier corresponding to target class a, the salience of the maximum misclassification rate in each misclassification rate sequence is determined. This salience reflects the degree of difference between the maximum misclassification rate in the misclassification rate sequence and the next second-largest misclassification rate; the higher the degree of difference, the greater the corresponding salience value.
[0077] In this embodiment of the invention, the salience of the maximum misclassification rate in each misclassification rate sequence is determined, and the corresponding calculation formula is as follows:
[0078] ;
[0079] in, This indicates that target category a is associated with its corresponding first category. The prominence of the maximum misclassification rate when the first base classifier misclassifies; This indicates that target category a is associated with its corresponding first category. The first misclassification rate in the sequence of misclassification rates obtained when the first base classifier misclassifies, that is, the misclassification rate of target class a by its corresponding classifier. The maximum misclassification rate among the misclassification rates of the first base classifier for each category; This indicates that target category a is associated with its corresponding first category. The second misclassification rate in the sequence of misclassification rates obtained when the first base classifier misclassifies a target class a, i.e., the target class a is misclassified by its corresponding class 1. The second-highest misclassification rate among the misclassification rates of the first base classifier for each category.
[0080] In the above formula, when the target category a is its corresponding first... When the first base classifier misclassifies a class, the larger the proportion of the difference between the first misclassification rate and the next misclassification rate in the misclassification rate sequence, the higher the degree of difference between the first misclassification rate (i.e., the maximum misclassification rate) and the next second-maximum misclassification rate. This indicates that the corresponding target class 'a' is more significantly affected by its corresponding misclassification rate. The larger the salience value of the maximum misclassification rate when the first base classifier misclassifies, the more easily the target class a is classified by its corresponding first base classifier. The first base classifier misclassifies the data into another category. The first base classifier has a high misclassification purity for the target class a, and the second base classifier has a high misclassification purity for the target class a. The more likely a first base classifier is to be used as the standard first base classifier for the target class a.
[0081] It should be understood that if the misclassification rate sequence of a certain first base classifier for the determined target category a contains only one misclassification rate, then the misclassification rate contained therein can be considered as the largest misclassification rate in the misclassification rate sequence, i.e., the first misclassification rate, while the second largest misclassification rate in the misclassification rate sequence, i.e., the second misclassification rate, is 0.
[0082] After determining the salience of the maximum misclassification rate in the misclassification rate sequence of all first base classifiers corresponding to target category a through the above method, the maximum salience among all saliences is determined, and the first base classifier corresponding to the maximum salience is taken as the standard first base classifier of target category a, and the other first base classifiers are taken as the first base classifiers to be analyzed for target category a.
[0083] Step S4: Based on the misclassification rate and samples of each target category being misclassified into each category by its corresponding first base classifier, determine the category samples of each target category corresponding to each first base classifier, and based on the difference between the category samples of each target category corresponding to each first base classifier to be analyzed and the standard first base classifier, determine the classification repetition degree corresponding to each first base classifier to be analyzed.
[0084] For target category a, if the misclassified category in the first base classifier to be analyzed has similar misclassification features to the misclassified category in the standard first base classifier, then the misclassification of target category a is most likely due to the first base classifier recognizing the common differences between target category a and other categories, that is, the information recognized by the base classifier has a large degree of repetition.
[0085] Based on this, refer to Figure 4Based on the misclassification rate and samples of each target category by each first base classifier, the class samples corresponding to each first base classifier for each target category are determined. The implementation steps include:
[0086] Step S401: Determine the first class sample corresponding to each target class for each first base classifier by taking all misclassified samples in the class corresponding to the largest misclassification rate among the misclassification rates of each target class being misclassified into each class by each of the first base classifiers.
[0087] Step S402: Determine all misclassified samples (excluding the first category samples) in each category by each target category misclassified by each corresponding first base classifier, and identify the second category samples corresponding to each target category and each first base classifier.
[0088] Step S403: Determine the class samples corresponding to each target class and each first base classifier for each target class.
[0089] Specifically, taking the standard first base classifier for target category a as an example, the misclassified sample corresponding to the maximum misclassification rate in the misclassification rate sequence of the standard first base classifier for target category a is denoted as the first category sample, and the misclassified samples corresponding to other misclassification rates in the misclassification rate sequence of the standard first base classifier for target category a are denoted as the second category samples. The first category samples and the second category samples of the standard first base classifier for target category a are collectively referred to as the category samples of the standard first base classifier for target category a.
[0090] For ease of understanding, for example, if there are 30 samples in target category a, and 10 samples are misclassified as category b, 2 samples are misclassified as category c, and 1 sample is misclassified as category d in the standard base classifier C, then the misclassification rate of target category a being misclassified as category b is the maximum misclassification rate. In this case, the 10 samples misclassified as category b are taken as the first category samples in target category a, and the 3 samples misclassified as categories c and d are taken as the second category samples in target category a.
[0091] refer to Figure 5 Based on the differences between the class samples of each target category and the standard first base classifier, the classification redundancy of each first base classifier to be analyzed is determined. The steps include:
[0092] Step S411: Based on the first category samples corresponding to each of the first base classifiers for each target category, determine the feature vector and feature value of the first category samples corresponding to each of the first base classifiers for each target category; and based on the second category samples corresponding to each of the first base classifiers for each target category, determine the feature vector and feature value of the second category samples corresponding to each of the first base classifiers for each target category.
[0093] Step S412: Match the feature vector of the first category sample corresponding to each of the target categories with the feature vector of the corresponding second category sample for each of the first base classifiers, to obtain the feature vector matching pair for each of the target categories corresponding to each of the first base classifiers;
[0094] Step S413: Filter the feature vector matching pairs of each target category corresponding to its standard first base classifier to determine the target feature vector matching pairs of each target category corresponding to its standard first base classifier;
[0095] Step S414: Based on the similarity between the feature vector matching pairs of each target category corresponding to each of its first base classifiers to be analyzed and the target feature vector matching pairs of each target category corresponding to its standard first base classifier, and combined with the feature values of each feature vector in the feature vector matching pairs of each target category corresponding to each of its first base classifiers to be analyzed, determine the feature value of each target category corresponding to each of its first base classifiers to be analyzed is larger.
[0096] Step S415: Based on the maximum feature value of each target category corresponding to each of the first base classifiers to be analyzed, determine the cumulative value of the maximum feature value of each of the first base classifiers to be analyzed for each target category, and obtain the classification repetition degree corresponding to each of the first base classifiers to be analyzed.
[0097] Specifically, taking the standard first base classifier for target category a as an example, after determining the first and second class samples of the standard first base classifier corresponding to target category a using the above method, each misclassified sample (i.e., the flatness vector) in the first class samples is used as a row of a matrix to obtain the first sample category matrix. Singular Value Decomposition (SVD) is then performed on this first sample category matrix to obtain a left singular matrix and a right singular matrix. The column data of the left singular matrix is extracted, with each column serving as a left singular vector, and the column data of the right singular matrix is extracted, with each column serving as a right singular vector. The left singular vector represents the change in the column space of the original matrix, and the right singular matrix represents the change in the row space of the original matrix. To preserve the main patterns or features of the rows of the original matrix, the right singular vector is retained as a feature vector, and the eigenvalues corresponding to each feature vector can be obtained. In this way, the feature vectors and eigenvalues of the first class samples of the standard first base classifier corresponding to target category a can be determined.
[0098] Using the same method described above, the feature vectors and feature values of the second sample class corresponding to the first base classifier of the target class a can be calculated. After obtaining the feature vectors and feature values of the first sample class corresponding to the first base classifier of the target class a, and the feature vectors and feature values of the second sample class corresponding to the first base classifier of the target class a, the KM algorithm (Kuhn–Munkres, Hungarian algorithm) is used to calculate the matching of the feature vectors of the first class sample and the second class sample. Existing KM algorithms calculate the matching of nodes on both sides, with each node on the left having an edge value with all nodes on the right. In this embodiment of the invention, the feature vector corresponding to the first class sample is used as the left node, and the feature vector corresponding to the second class sample is used as the right node. Each node on the left has an edge value with all nodes on the right, and the edge value is the cosine similarity between the corresponding two feature vectors. Matching using the KM algorithm yields one-to-one matches between left and right nodes, resulting in feature vector matching relationships. Each one-to-one match is denoted as a feature vector matching pair. Feature vector matching pairs whose boundary values exceed a set boundary value threshold are denoted as target feature vector matching pairs. These target feature vector matching pairs represent the features of misclassified samples of target category a in the standard first base classifier, and are therefore also called recognition features. In other words, the standard first base classifier's recognition of these features leads to misclassification of target category a. The specific value of the boundary value threshold can be reasonably selected as needed; in this embodiment, the boundary value threshold is set to 0.8.
[0099] Through the above steps, by determining the first and second class samples of the standard first base classifier corresponding to target category a, the feature vectors and corresponding feature values of the first class samples, and the feature vectors and corresponding feature values of the second class samples can be determined. Finally, each feature vector matching pair and the target feature vector matching pair within the feature vector matching pairs are determined. Following the same method, the first and second class samples of each first base classifier to be analyzed corresponding to target category a can also be determined. This allows for the determination of the feature vectors and corresponding feature values of the first class samples, and the feature vectors and corresponding feature values of the second class samples, ultimately determining each feature vector matching pair. It should be understood that for each first base classifier to be analyzed, it is not necessary to determine the target feature vector matching pair within the resulting feature vector matching pairs.
[0100] For target category a, if the feature vector matching pair of the first base classifier to be analyzed is similar to the recognition features of the standard first base classifier corresponding to target category a, and the greater the salience of the feature value of the feature vector in the feature vector matching pair, that is, the stronger the feature vector is similar to the recognition feature, then the recognition feature is likely to be a common feature of all other categories that target category a was misclassified as, that is, there is a large degree of repetition in the corresponding base classifier, and the information repetition between the first base classifier to be analyzed and the standard first base classifier is high.
[0101] Based on this, refer to Figure 6 Based on the similarity between the feature vector matching pairs of each target category corresponding to each of its first base classifiers to be analyzed and the target feature vector matching pairs of each target category corresponding to its standard first base classifier, and combined with the feature values of each feature vector in the feature vector matching pairs of each target category corresponding to each of its first base classifiers to be analyzed, the likelihood of a larger feature value for each target category corresponding to each of its first base classifiers to be analyzed is determined. The implementation steps include:
[0102] Step S421: Determine the mean of the two feature vectors in the feature vector matching pair of each target category corresponding to each of the first base classifiers to be analyzed, and obtain the mean feature vector of each feature vector matching pair;
[0103] Step S422: Determine the mean of all feature vectors in all target feature vector matching pairs corresponding to each target category and its standard first base classifier to obtain the benchmark mean feature vector;
[0104] Step S423: Calculate the cosine similarity between the mean feature vector of each feature vector matching pair and the benchmark mean feature vector, and record the mean feature vector corresponding to the maximum cosine similarity as the corresponding vector;
[0105] Step S424: Determine the maximum and second maximum eigenvalues among the eigenvalues of all feature vectors in all feature vector matching pairs corresponding to each target category for each of the first base classifiers to be analyzed, and determine the salience of the maximum eigenvalue of each target category for each of the first base classifiers to be analyzed based on the maximum and second maximum eigenvalues.
[0106] Step S425: Determine the average value of the two feature vectors corresponding to the corresponding vector of each target category and each of the first base classifiers to be analyzed, to obtain the average feature value, and determine the ratio of the average feature value to the maximum feature value, to obtain the feature value ratio;
[0107] Step S426: Based on the maximum salience and eigenvalue ratio of each target category for each of its first base classifiers to be analyzed, determine the eigenvalue maximality of each target category for each of its first base classifiers to be analyzed. The maximum eigenvalue salience and eigenvalue ratio are both positively correlated with the eigenvalue maximality.
[0108] Specifically, for any first base classifier D of target category a, for multiple feature vector matching pairs corresponding to the first base classifier D, the mean of the two feature vectors in each feature vector matching pair is calculated to obtain the mean feature vector of each feature vector matching pair. Simultaneously, the mean of all feature vectors in all target feature vector matching pairs of the standard first base classifier corresponding to target category a is calculated to obtain the baseline mean feature vector. The cosine similarity between the mean feature vector of each feature vector matching pair and the baseline mean feature vector is calculated, and the mean feature vector corresponding to the maximum cosine similarity is denoted as the corresponding vector. The corresponding vector represents the vector with the maximum similarity to the target feature vector matching pair, and the corresponding vector and the target feature vector matching pair likely represent the same feature. The larger the corresponding vector is among the feature values of all feature vector matching pairs, the more likely the recognition vector is to represent a common feature of the misclassified category, i.e., the stronger the feature repetition of these base classifiers.
[0109] The eigenvalues of all feature vectors in the multiple feature vector matching pairs corresponding to the first base classifier D to be analyzed are sorted in descending order to obtain a eigenvalue sequence. Following the same method used to determine the salience of the maximum misclassification rate in each misclassification rate sequence, the salience of the maximum eigenvalue in this eigenvalue sequence is calculated; this is referred to as the maximum eigenvalue salience. Simultaneously, the average eigenvalue of the two eigenvectors corresponding to the corresponding vector of the first base classifier D to be analyzed is determined to obtain the average eigenvalue. The ratio of this average eigenvalue to the maximum eigenvalue in the eigenvalue sequence is then calculated to obtain the eigenvalue ratio.
[0110] Following the above method, the salience of the maximum eigenvalue corresponding to each target category and the eigenvalue ratio corresponding to each target category and each first base classifier can be determined. Based on the salience of the maximum eigenvalue and the eigenvalue ratio, the maximality of the eigenvalue corresponding to each target category and each first base classifier can be determined. Both the salience of the maximum eigenvalue and the eigenvalue ratio are positively correlated with the maximality of the eigenvalue.
[0111] In this embodiment of the invention, the feature value of any first base classifier to be analyzed corresponding to each target category is determined to be larger, and the corresponding calculation formula is as follows:
[0112] ;
[0113] in, This indicates the magnitude of the feature values of each target category corresponding to each of its first base classifiers to be analyzed; This represents the saliency of the maximum feature value for each target category corresponding to each of its first base classifiers to be analyzed; This represents the ratio of feature values for each target category to the first base classifier to be analyzed.
[0114] In the above formula, the greater the prominence of the largest eigenvalue in the eigenvalue sequence, the greater the ratio of the eigenvalue to the corresponding vector. This indicates that the corresponding vector has a greater degree of overlap in the classification performance between the first base classifier to be analyzed and the standard first base classifier. In this case, it is more necessary to screen the base classifiers, and the larger the value of the corresponding eigenvalue will be.
[0115] To filter the base classifiers, for each target category, we can obtain the largest feature value of multiple first base classifiers to be analyzed for that target category. Correspondingly, for each first base classifier to be analyzed, we can obtain the largest feature value of the corresponding vector for different target categories. We calculate the sum of all the largest feature values to obtain the classification repetition, and finally obtain the classification repetition for each first base classifier to be analyzed.
[0116] Step S5: Based on the classification repetition, the base classifiers are screened to obtain each base classifier to be integrated. All the base classifiers to be integrated are integrated to obtain an integrated classifier, and the integrated classifier is used to detect the flatness of the ground.
[0117] The classification repetition rates of each base classifier to be analyzed are sorted in descending order to obtain a classification repetition rate sequence. The top-ranked (by a predetermined number) base classifiers in this sequence are removed, and all remaining base classifiers are used as the base classifiers to be integrated. The predetermined number is the difference between a first predetermined number and a second predetermined number. In this embodiment, the first predetermined number is set to 20, and the second predetermined number is set to 15; therefore, the predetermined number is set to 5.
[0118] In the AdaBoost algorithm, an ensemble classifier is obtained by integrating all the base classifiers obtained above. This ensemble classifier is then trained using all samples from the aforementioned sample set, resulting in a trained ensemble classifier that can be used for flatness detection.
[0119] When using the trained ensemble classifier for flatness detection, a laser sensor is used to detect the flatness of the surface under test in real time, obtaining the corresponding flatness vector. This flatness vector is then input into the trained ensemble classifier, which outputs the corresponding flatness level, thus obtaining the detection result. Based on this detection result, it can be determined whether the surface under test meets the requirements.
[0120] System Implementation Example:
[0121] Based on the same inventive concept, this invention also provides a floor flatness detection system. The system includes a processor and a memory. The processor processes computer program code stored in the memory to implement the steps of a floor flatness detection method described in the above method embodiments. Since this system is essentially a software system, its focus and purpose are to implement a floor flatness detection method as described in the above method embodiments. Because this method has already been described in detail in the above method embodiments, the system will not be described further here.
[0122] It should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for detecting the flatness of a floor, characterized in that, Includes the following steps: Obtain a sample set, wherein each sample in the sample set is a flatness vector corresponding to each floor surface, and each flatness vector corresponds to a flatness level; All samples in the sample set are classified to obtain various categories, each category corresponding to a flatness level. Based on the misclassification rate of each base classifier for each category, the target category in each category and the first base classifier corresponding to each target category are determined. Based on the misclassification rate of each target category by its corresponding first base classifier, determine the standard first base classifier and the first base classifier to be analyzed among the first base classifiers corresponding to each target category; Based on the misclassification rate and samples of each target category being misclassified into each category by its corresponding first base classifier, the category samples of each target category corresponding to each first base classifier are determined, and based on the difference between the category samples of each target category corresponding to each first base classifier to be analyzed and the standard first base classifier, the classification repetition degree corresponding to each first base classifier to be analyzed is determined. Based on the classification repetition, the base classifiers are screened to obtain each base classifier to be integrated. All the base classifiers to be integrated are then integrated to obtain an integrated classifier, which is then used to detect the flatness of the ground. Determining the target category in each category and the first base classifier corresponding to each target category includes: The misclassification rate of each base classifier for each category is compared with the misclassification rate threshold. Categories with misclassification rates greater than the misclassification rate threshold are identified as the misclassified categories corresponding to the base classifier. Determine the category corresponding to the maximum misclassification rate among the misclassification rates of each base classifier for each category. If the category corresponding to the maximum misclassification rate belongs to the misclassifiable category corresponding to the base classifier, then the category corresponding to the maximum misclassification rate is determined as a target category, and the corresponding base classifier is determined as a first base classifier of the target category. Determining the standard first base classifier and the first base classifier to be analyzed in the first base classifier corresponding to each target category includes: Determine the maximum and second-maximum misclassification rates among the misclassification rates of each target category by its corresponding first base classifier for each category; Based on the difference between the maximum misclassification rate and the second-maximum misclassification rate of each target category when it is misclassified by each of the first base classifiers, the salience of the maximum misclassification rate of each target category when it is misclassified by each of the first base classifiers is determined. The maximum salience among the saliences of the maximum misclassification rates of all the first base classifiers corresponding to each target category is determined, and the first base classifier corresponding to the maximum salience is used as the standard first base classifier for the target category, while the other first base classifiers are used as the first base classifiers to be analyzed for the target category.
2. The method for detecting the flatness of a floor according to claim 1, characterized in that, The salience of determining the maximum misclassification rate of each target category when it is misclassified by its corresponding first base classifier is calculated using the following formula: ; in, This indicates that target category a is associated with its corresponding first category. The prominence of the maximum misclassification rate when the first base classifier misclassifies; This indicates that target category a is associated with its corresponding first category. The maximum misclassification rate of the first base classifier in each category; This indicates that target category a is associated with its corresponding first category. The second-largest misclassification rate of the first base classifier for each category.
3. The method for detecting the flatness of a floor according to claim 1, characterized in that, Determining the category samples corresponding to each of the target categories for each of the first base classifiers includes: All misclassified samples in the category corresponding to the largest misclassification rate among the misclassification rates of each target category by each of its corresponding first base classifiers are determined as the first category samples corresponding to each target category by each of its first base classifiers. For each target category, all misclassified samples other than the first category samples are identified by each of its corresponding first base classifiers and are determined as the second category samples corresponding to each target category and its first base classifier. For each target category, the first category sample and the second category sample of each of its first base classifiers are determined to be the category sample of each target category corresponding to each of its first base classifiers.
4. The method for detecting the flatness of a floor according to claim 3, characterized in that, Determining the classification redundancy of each of the first base classifiers to be analyzed includes: Based on the first category samples corresponding to each of the target categories and each of the first base classifiers, determine the feature vector and its feature value of the first category samples corresponding to each of the target categories and each of the first base classifiers; and based on the second category samples corresponding to each of the target categories and each of the first base classifiers, determine the feature vector and its feature value of the second category samples corresponding to each of the target categories and each of the first base classifiers. For each target category, the feature vector of the first category sample corresponding to each first base classifier is matched with the feature vector of the corresponding second category sample to obtain a feature vector matching pair for each target category corresponding to each first base classifier. Filter the feature vector matching pairs corresponding to the standard first base classifier for each target category to determine the target feature vector matching pairs corresponding to the standard first base classifier for each target category; Based on the similarity between the feature vector matching pairs of each target category corresponding to each of its first base classifiers to be analyzed and the target feature vector matching pairs of each target category corresponding to its standard first base classifier, and combined with the feature values of each feature vector in the feature vector matching pairs of each target category corresponding to each of its first base classifiers to be analyzed, the feature value of each target category corresponding to each of its first base classifiers to be analyzed is determined to be larger. Based on the maximum feature value of each target category corresponding to each of the first base classifiers to be analyzed, the cumulative value of the maximum feature value of each of the first base classifiers to be analyzed for each target category is determined, and the classification repetition degree corresponding to each of the first base classifiers to be analyzed is obtained.
5. The method for detecting the flatness of a floor according to claim 4, characterized in that, Determining the maximality of feature values for each target category corresponding to each of the first base classifiers to be analyzed includes: Determine the mean of the two feature vectors in the feature vector matching pair corresponding to each target category for each of the first base classifiers to be analyzed, and obtain the mean feature vector of each feature vector matching pair; The mean of all feature vectors in all target feature vector matching pairs corresponding to each target category and its standard first base classifier is determined to obtain the benchmark mean feature vector; Calculate the cosine similarity between the mean feature vector of each feature vector matching pair and the benchmark mean feature vector, and denote the mean feature vector corresponding to the maximum cosine similarity as the corresponding vector; The maximum and second maximum eigenvalues among all feature values corresponding to all feature vectors in all feature vector matching pairs for each target category and each of the first base classifiers to be analyzed are determined, and the salience of the maximum eigenvalue for each target category and each of the first base classifiers to be analyzed is determined based on the maximum and second maximum eigenvalues. The average feature value is obtained by determining the average feature value of the two feature vectors corresponding to the corresponding vector of each target category and each of the first base classifiers to be analyzed; the ratio of the average feature value to the maximum feature value is determined to obtain the feature value ratio. Based on the maximum salience and eigenvalue ratio of each target category for each of its first base classifiers to be analyzed, the eigenvalue maximization of each target category for each of its first base classifiers to be analyzed is determined, wherein the maximum eigenvalue salience and eigenvalue ratio are both positively correlated with the eigenvalue maximization.
6. The method for detecting the flatness of a floor according to claim 5, characterized in that, Determining the maximality of feature values for each target category corresponding to each of the first base classifiers to be analyzed includes: The product of the maximum salience of the feature value and the feature value ratio of each target category corresponding to each of the first base classifiers to be analyzed is determined as the feature value maximization of each target category corresponding to each of the first base classifiers to be analyzed.
7. The method for detecting the flatness of a floor according to claim 1, characterized in that, The base classifiers are filtered to obtain the various base classifiers to be integrated, including: Remove the set number of base classifiers with the highest classification repetition and use all remaining base classifiers as base classifiers to be integrated.
8. A floor flatness detection system, characterized in that, It includes a processor and a memory, the processor being used to process computer program code stored in the memory to implement the steps of a method for detecting floor flatness as described in any one of claims 1-7.
Citation Information
Patent Citations
Machine learning-based polyurethane self-flowing floor flatness detection and optimization method
CN118135359A
Bladder tumor prognosis prediction method based on machine learning
CN118888159A