An eagle-eye material identification method, system and device based on causal reasoning

By employing the Eagle Eye material identification method based on causal reasoning, and combining multi-view images and parameter information, a dependency tree Naive Bayes classification model and a causal forest algorithm are constructed. This solves the instability problem of material identification in complex environments and achieves high-precision and robust identification.

CN122200152APending Publication Date: 2026-06-12SHENYANG YUNHE ENVIRONMENTAL PROTECTION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENYANG YUNHE ENVIRONMENTAL PROTECTION TECHNOLOGY CO LTD
Filing Date
2026-03-27
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing material identification methods rely on a single perspective and traditional models, which cannot effectively model the relationships between features, resulting in unstable identification results under complex work environment and changing imaging conditions.

Method used

We employ an eagle-eye material identification method based on causal reasoning, combining multi-view images and parameter information to construct a dependency tree-based Naive Bayes classification model and a causal forest algorithm, thereby achieving dynamic optimization of material category identification and imaging parameters.

Benefits of technology

It improves the accuracy and adaptability of material identification, maintains the stability of identification results, automatically adjusts imaging strategies to adapt to complex working conditions, reduces manual parameter adjustment, and improves the automation level of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122200152A_ABST
    Figure CN122200152A_ABST
Patent Text Reader

Abstract

The application discloses an eagle-eye material identification method, system and device based on causal reasoning, comprising the following steps: S1, collecting images and performing pretreatment and feature extraction to form a training data set; S2, counting information to generate category prior information and feature conditional probability structure; S3, constructing a naive Bayes classification model of a dependency tree; S4, constructing a basic decision tree structure containing a split feature, a split threshold and a split direction; S5, constructing a causal forest model with a multi-tree cross-validation structure; S6, inputting a to-be-identified feature vector into the naive Bayes classification model of the dependency tree to output a material category identification result; and S7, inputting the to-be-identified feature vector and imaging parameters into the causal forest model to calculate an imaging parameter influence value and select a target imaging configuration to re-collect images until the identification result converges. The application realizes the improvement of material identification precision and imaging stability, and enhances the identification reliability and adaptability in a complex environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent visual inspection technology, and in particular to an eagle-eye material recognition method, system and device based on causal reasoning. Background Technology

[0002] With the increasing automation of industrial manufacturing processes, visual recognition-based material inspection technology has become an indispensable tool in the production process. Existing material identification methods typically rely on image data from a single viewpoint, using traditional image processing algorithms or conventional machine learning classification models to determine material categories. Complex workstation environments, differences in material appearance, and variations in imaging conditions can easily lead to fluctuations in image quality, causing instability in the identification results. Many identification models rely on large amounts of labeled data for training, ignoring the impact of image imaging conditions themselves on identification performance, making it difficult to maintain identification accuracy under different acquisition conditions.

[0003] Most existing material identification technologies are based on classification models with fixed structures, such as conventional Naive Bayes models, support vector machines, or convolutional neural networks. These models typically assume that features are independent of each other and cannot effectively model the relationships between features, easily leading to problems such as insufficient feature dependency and biased classification results. When imaging parameters such as illumination, angle, and focal length change, existing algorithms lack the ability to evaluate changes in recognition performance and cannot dynamically adjust imaging strategies according to the influence of imaging parameters, resulting in unstable recognition performance under different working conditions.

[0004] Therefore, how to provide an eagle-eye material identification method, system, and device based on causal reasoning is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose an eagle-eye material identification method, system, and device based on causal reasoning. This invention comprehensively utilizes the Naive Bayes classification model of dependency tree and the causal forest algorithm with cross-validation mechanism to construct an interpretable and adaptive identification process, realize material category identification and dynamic optimization of imaging parameters, and has the advantages of high identification accuracy and strong adaptability to complex workstation environments.

[0006] According to an embodiment of the present invention, an eagle-eye material identification method, system, and apparatus based on causal reasoning includes the following steps: S1. Acquire multi-view images, parameters, and workstation environment information of materials, perform preprocessing and feature extraction, and form a training dataset; S2. Based on the training dataset, establish the basic probability structure of the Naive Bayes classification model and generate category prior information and feature conditional probability structure. S3. Construct a feature dependency tree based on the correlation of features within the training dataset, and introduce the feature dependency tree into the Naive Bayes classification structure to form a Naive Bayes classification model with dependency tree. S4. Construct causal forest training data and generate multiple basic decision tree structures for causal reasoning; S5. During the generation of each decision tree, the splitting results of candidate nodes are cross-validated through other decision trees, and the splitting results that pass the validation are retained to form a causal forest model with a cross-validation structure. S6. After preprocessing and feature extraction, the image to be identified is formed into a feature vector to be identified. This vector is then input into the Naive Bayes classification model of the dependency tree, and the material category identification result is output. S7. Input the feature vector to be identified and the current imaging parameters into the causal forest model to obtain the recognition performance evaluation result. Select the target imaging configuration to re-acquire the material image. Repeat the S1 to S6 operations until the recognition result converges and output the material recognition model.

[0007] Optionally, S1 specifically includes: S11. During the production line operation, images of the material under test are acquired by eagle-eye multi-view imaging devices set at multiple workstations. Top view images, side view images, and tilted view images are acquired in chronological order as the material passes through different imaging positions to form an original image sequence. While completing image acquisition, the imaging parameter information corresponding to each view is recorded. The imaging parameter information includes exposure value, light source brightness, light source angle, camera focal length, and resolution parameters. The workstation environment information when the material is at the imaging position is also recorded. The workstation environment information includes workstation number, ambient brightness, background reflection characteristics, and mechanical position offset. After acquiring the original image sequence, each image is subjected to denoising, distortion correction, brightness equalization and size normalization to obtain a preprocessed image. Texture features are extracted from the preprocessed image using texture description operators, edge direction features are extracted using gradient direction histogram method, shape features are extracted using shape fitting method, corresponding viewpoint features are extracted from multi-view images, and imaging parameter information and workstation environment information are added as additional feature information to construct a structured feature vector. Each structured feature vector is associated with its corresponding material category label and recognition result label to generate a training dataset containing preprocessed images, imaging parameter information, workstation environment information, structured feature vectors, and label information.

[0008] Optionally, S2 specifically includes: S21. Read each structured feature vector and its corresponding material category label from the training dataset. Count the number of samples for each material category in the training dataset. Count the total number of samples. Divide the number of samples for each material category by the total number of samples to obtain the prior probability of the corresponding material category. Establish a one-to-one correspondence between each material category and its corresponding prior probability to obtain the category prior information. S22. For each material category in the training dataset, select structured feature vectors with the same category label from the training dataset, split the structured feature vectors in order of feature dimension, and form a feature value sequence for each feature dimension under each material category. S23. Under each material category, count the number of times different values ​​appear in each feature value sequence and calculate the relative frequency to obtain the discrete feature conditional probability value. Calculate the statistical mean and variance for the continuous feature value sequence. Store each material category, each feature dimension, the corresponding discrete feature conditional probability value, and the continuous feature statistical parameters to form a feature conditional probability structure.

[0009] Optionally, S3 specifically includes: S31. For each pair of different feature dimensions in the training dataset, read the values ​​of the two feature dimensions for each sample, count the frequency of the same value combination, and obtain the probability of the current feature dimension value. S32. For each pair of feature dimensions, iterate through all combinations of values, divide the joint probability of each combination of values ​​by the product of the probabilities of the two corresponding values, and obtain the correlation factor corresponding to the combination of values. Add up the correlation factors of all combinations of values ​​for the same feature pair to obtain the correlation value of the feature dimension. S33. Sort all feature pairs by correlation values ​​from largest to smallest. Starting from the first position of the sort, select feature pairs one by one. When selecting a new feature pair, if the new feature pair does not produce a closed loop after being merged with the existing structure, add the new feature pair to the structure until all feature dimensions are connected. S34. In the maximum correlation structure, select any feature dimension as the root feature dimension, and expand outward layer by layer along the connection relationship starting from the root feature dimension. During the expansion process, set the upper level connection feature dimension of each new feature dimension as the parent feature dimension until all feature dimensions are assigned parent-child relationships. S35. Locate the feature conditional probability of the root feature dimension under each material category, and directly use the feature conditional probability as the reference content of the conditional probability of the root feature dimension. S36. For each non-root feature dimension, in the feature conditional probability structure, traverse all combinations of values ​​of the feature dimension and the parent feature dimension, find the conditional probability value corresponding to each combination, and record the conditional probability value of each combination as the conditional probability reference content of the non-root feature dimension. S37. Integrate the prior probability of the category with the conditional probabilities of the root feature dimension and non-root feature dimensions according to the parent-child order of the feature dependency tree to form a Naive Bayes classification model of the dependency tree.

[0010] Optionally, the Naive Bayes classification model operation process in S3 specifically includes: To identify the feature vector, the prior information of the category is read in the Naive Bayes classification model of the dependency tree, and the corresponding prior probability is obtained for each material category. Obtain the root feature dimension value in the feature vector to be identified, find the conditional probability of the root feature dimension under each material category from the Naive Bayes classification model of the dependency tree, and multiply the prior probability of each material category with the corresponding conditional probability to obtain the intermediate probability of the root feature dimension. Each non-root feature dimension is processed sequentially according to the parent-child relationship of the feature dependency tree. The value of the feature dimension and the value of the parent feature dimension are obtained. The conditional probability corresponding to the combination of the two values ​​under each material category is found in the Naive Bayes classification model of the dependency tree. The conditional probability is multiplied by the intermediate probability calculated for the same material category in the previous feature dimension to obtain the next layer intermediate probability of the material category. After all feature dimensions have completed intermediate probability calculations, the final classification probability for each material category is obtained. The material category with the highest final classification probability among all material categories is selected as the recognition result, and the feature vector to be identified and the recognition result are output.

[0011] Optionally, S4 specifically includes: S41. Read each structured feature vector, corresponding imaging parameters, and recognition result label from the training dataset. Use the structured feature vector as a covariate for causal inference, the imaging parameters as a processing variable, and the recognition result label as a result variable. S42. Divide the different values ​​of the processing variable and assign the samples in the training dataset that belong to different values ​​to the corresponding sample sets. S43. In each set of processing variables, randomly select a portion of samples and randomly select a portion of feature dimensions to form sub-samples and sub-features; select a portion of samples from the training dataset as training samples for the current decision tree by random sampling, and select a portion of feature dimensions from all feature dimensions as candidate splitting features for the current decision tree by random sampling; the sample sampling ratio and feature sampling ratio are preset values. S44. Read the structured feature vectors one by one from the subsamples, calculate the split index under different feature dimensions at each candidate split position, and select the feature dimension with the best value from the split indexes corresponding to all candidate feature dimensions as the split feature of the current node. S45. Based on the splitting features of the current node, divide the subsamples into several subsets according to the different values ​​of the features. Take each subset as a new construction branch and repeat the splitting feature calculation and sample partitioning operation on each branch until the preset tree depth or sample number limit is reached to form a basic decision tree structure. S46. Repeat S43 to S45 to construct several basic decision trees with different subsamples and subfeatures.

[0012] Optionally, S5 specifically includes: S51. When constructing the basic decision tree, select the splitting features and splitting thresholds for each candidate splitting position in the current basic decision tree, and determine the splitting information of the candidate nodes corresponding to the splitting features and splitting thresholds. S52. Send the candidate node splitting information to other basic decision trees besides the current basic decision tree. For each other basic decision tree, search in the tree structure of the other basic decision tree whether there is a feature dimension that is the same as the splitting feature in the candidate node splitting information, and find the splitting position and splitting direction of the feature dimension in the other basic decision trees. S53. Judge the search results of each other basic decision tree. If no feature dimension with the same splitting feature as the splitting feature in the splitting information of the candidate node is found in the other basic decision trees, or if the splitting position and splitting direction found are inconsistent with the splitting position and splitting direction in the splitting information of the candidate node, then mark the verification result of the other basic decision trees as failing. S54. Statistically analyze the verification results of all other basic decision trees. If the number of basic decision trees that have passed verification reaches a preset number, add the candidate node splitting information to the tree structure of the current basic decision tree as a new splitting node. S55. If the number of verified basic decision trees does not reach the preset number, discard the candidate node splitting information, reselect new splitting features and splitting thresholds for the same candidate splitting position of the current basic decision tree, and return to S51. S56. After all nodes of the current basic decision tree have been processed, a basic decision tree structure with cross-validation is formed. The basic decision tree structure with cross-validation is combined with other basic decision tree structures with cross-validation to form a causal forest model with a multi-tree cross-validation structure.

[0013] Optionally, S7 specifically includes: The feature vector to be identified and the imaging parameters are input into a causal forest model with a multi-tree cross-validation structure. In each basic decision tree of the causal forest model, the feature vector to be identified and the imaging parameters are judged according to the splitting characteristics, splitting threshold and splitting direction of the tree structure until the corresponding leaf node is reached, and the sample statistical information in the leaf node is recorded. In the causal forest model, the statistical information of the leaf nodes of all basic decision trees is integrated, and the influence of imaging parameters on the material category identification results is numerically calculated to obtain the influence value between imaging parameters and identification performance. All available imaging parameters are sorted according to their impact values, and the imaging parameter with the highest improvement in recognition performance is selected as the target imaging configuration from the sorting results. The parameters of the imaging device are set according to the target imaging configuration. The material image is re-acquired using the target imaging configuration. The acquired image is preprocessed and feature extracted. The preprocessed and feature extracted data is used as a new feature vector to be identified. The new feature vector to be identified is re-inputted into the Naive Bayes classification model of the dependency tree to obtain the new material category identification result. The new feature vector to be identified and the new material category identification result are then output. When the change between the new material category identification result and the previous material category identification result is less than the preset change value, the imaging configuration selection operation ends and the final material identification model is formed.

[0014] An eagle-eye material identification system based on causal reasoning according to an embodiment of the present invention includes: The data processing module is used to collect data, perform preprocessing and feature extraction operations, and form a training dataset and a feature vector to be identified. The Naive Bayes dependency tree building module is used to generate category prior information and feature conditional probability structure, and calculate feature correlation values ​​to form a feature dependency tree to build a Naive Bayes classification model based on the dependency tree. The causal forest cross-validation building module is used to generate basic decision trees containing splitting features, splitting thresholds, and splitting directions, and to perform validation using the splitting information of other basic decision trees to build a causal forest model with a multi-tree cross-validation structure. The material identification and imaging configuration optimization module is used to calculate the influence value of imaging parameters based on the causal forest model, select the target imaging configuration, and output the final material identification model by comparing the new identification result with the previous identification result.

[0015] An edge computing device stores a computer program that, when executed by a processor, enables the processor to perform an eagle-eye material identification method based on causal reasoning.

[0016] The beneficial effects of this invention are: (1) This invention obtains more comprehensive material appearance information through multi-view imaging and uses feature dependency tree to enhance the Naive Bayes model to effectively model the feature association relationship, overcoming the defects of the traditional model feature independence assumption, so that the material identification results can still maintain high accuracy and high robustness in complex work environment.

[0017] (2) By introducing a causal forest model with a multi-tree cross-validation structure, this invention explicitly evaluates the real impact of different imaging parameters on the recognition results, realizes intelligent optimization of imaging strategy, and enables the system to automatically adjust imaging configuration under parameter change scenarios to maintain stable detection performance.

[0018] (3) The present invention feeds back the optimal imaging configuration output by causal reasoning to the acquisition process, and iterates in a closed loop. When the recognition results tend to converge, the final model is output, which effectively avoids manual parameter tuning and improves the automation level and industrial deployment efficiency of the system. Attached Figure Description

[0019] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of an eagle-eye material identification method based on causal reasoning proposed in this invention; Figure 2 This is a schematic diagram of the causal forest multi-tree cross-validation mechanism of the eagle eye material identification method based on causal reasoning proposed in this invention; Figure 3 This is an iterative loop diagram for the imaging configuration optimization of the eagle-eye material identification method, system, and device based on causal reasoning proposed in this invention. Detailed Implementation

[0020] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0021] refer to Figure 1-3 An eagle-eye material identification method, system, and apparatus based on causal reasoning includes the following steps: S1. Acquire multi-view images, parameters, and workstation environment information of materials, perform preprocessing and feature extraction, and form a training dataset; S2. Based on the training dataset, establish the basic probability structure of the Naive Bayes classification model and generate category prior information and feature conditional probability structure. S3. Construct a feature dependency tree based on the correlation of features within the training dataset, and introduce the feature dependency tree into the Naive Bayes classification structure to form a Naive Bayes classification model with dependency tree. S4. Construct causal forest training data and generate multiple basic decision tree structures for causal reasoning; S5. During the generation of each decision tree, the splitting results of candidate nodes are cross-validated through other decision trees, and the splitting results that pass the validation are retained to form a causal forest model with a cross-validation structure. S6. After preprocessing and feature extraction, the image to be identified is formed into a feature vector to be identified. This vector is then input into the Naive Bayes classification model of the dependency tree, and the material category identification result is output. S7. Input the feature vector to be identified and the current imaging parameters into the causal forest model to obtain the recognition performance evaluation result. Select the target imaging configuration to re-acquire the material image. Repeat the S1 to S6 operations until the recognition result converges and output the material recognition model.

[0022] In this embodiment, S1 specifically includes: S11. During the production line operation, images of the material under test are acquired by eagle-eye multi-view imaging devices set at multiple workstations. Top view images, side view images, and tilted view images are acquired in chronological order as the material passes through different imaging positions to form an original image sequence. While completing image acquisition, the imaging parameter information corresponding to each view is recorded. The imaging parameter information includes exposure value, light source brightness, light source angle, camera focal length, and resolution parameters. The workstation environment information when the material is at the imaging position is also recorded. The workstation environment information includes workstation number, ambient brightness, background reflection characteristics, and mechanical position offset. After acquiring the original image sequence, each image is subjected to denoising, distortion correction, brightness equalization and size normalization to obtain a preprocessed image. Texture features are extracted from the preprocessed image using texture description operators, edge direction features are extracted using gradient direction histogram method, shape features are extracted using shape fitting method, corresponding viewpoint features are extracted from multi-view images, and imaging parameter information and workstation environment information are added as additional feature information to construct a structured feature vector. Each structured feature vector is associated with its corresponding material category label and recognition result label to generate a training dataset containing preprocessed images, imaging parameter information, workstation environment information, structured feature vectors, and label information.

[0023] In this embodiment, S2 specifically includes: S21. Read each structured feature vector and its corresponding material category label from the training dataset. Count the number of samples for each material category in the training dataset. Count the total number of samples. Divide the number of samples for each material category by the total number of samples to obtain the prior probability of the corresponding material category. Establish a one-to-one correspondence between each material category and its corresponding prior probability to obtain the category prior information. S22. For each material category in the training dataset, select structured feature vectors with the same category label from the training dataset, split the structured feature vectors in order of feature dimension, and form a feature value sequence for each feature dimension under each material category. S23. Under each material category, count the number of times different values ​​appear in each feature value sequence and calculate the relative frequency to obtain the discrete feature conditional probability value. Calculate the statistical mean and variance for the continuous feature value sequence. Store each material category, each feature dimension, the corresponding discrete feature conditional probability value, and the continuous feature statistical parameters to form a feature conditional probability structure.

[0024] In this embodiment, S3 specifically includes: S31. For each pair of different feature dimensions in the training dataset, read the values ​​of the two feature dimensions for each sample, count the frequency of the same value combination, and obtain the probability of the current feature dimension value. S32. For each pair of feature dimensions, iterate through all combinations of values, divide the joint probability of each combination of values ​​by the product of the probabilities of the two corresponding values, and obtain the correlation factor corresponding to the combination of values. Add up the correlation factors of all combinations of values ​​for the same feature pair to obtain the correlation value of the feature dimension. S33. Sort all feature pairs by correlation values ​​from largest to smallest. Starting from the first position of the sort, select feature pairs one by one. When selecting a new feature pair, if the new feature pair does not produce a closed loop after being merged with the existing structure, add the new feature pair to the structure until all feature dimensions are connected. S34. In the maximum correlation structure, select any feature dimension as the root feature dimension, and expand outward layer by layer along the connection relationship starting from the root feature dimension. During the expansion process, set the upper level connection feature dimension of each new feature dimension as the parent feature dimension until all feature dimensions are assigned parent-child relationships. S35. Locate the feature conditional probability of the root feature dimension under each material category, and directly use the feature conditional probability as the reference content of the conditional probability of the root feature dimension. S36. For each non-root feature dimension, in the feature conditional probability structure, traverse all combinations of values ​​of the feature dimension and the parent feature dimension, find the conditional probability value corresponding to each combination, and record the conditional probability value of each combination as the conditional probability reference content of the non-root feature dimension. S37. Integrate the prior probability of the category with the conditional probabilities of the root feature dimension and non-root feature dimensions according to the parent-child order of the feature dependency tree to form a Naive Bayes classification model of the dependency tree.

[0025] In this embodiment, the operation process of the Naive Bayes classification model in S3 specifically includes: To identify the feature vector, the prior information of the category is read in the Naive Bayes classification model of the dependency tree, and the corresponding prior probability is obtained for each material category. Obtain the root feature dimension value from the feature vector to be identified. Find the conditional probability of the root feature dimension for each material category from the Naive Bayes classification model of the dependency tree. Multiply the prior probability of each material category by the corresponding conditional probability to obtain the intermediate probability of the root feature dimension. Let the material category be C, the root node feature be Xr, any non-root feature be Xi, and its parent feature be Xp(i). Then, in the Naive Bayes model of the dependency tree, the intermediate probabilities of each category are calculated as follows: Calculation of the intermediate probability of the root feature. ; Each non-root feature dimension is processed sequentially according to the parent-child relationship of the feature dependency tree, obtaining the value of the feature dimension and the value of the parent feature dimension. The conditional probability corresponding to the combination of these two values ​​under each material category is found in the Naive Bayes classification model of the dependency tree. This conditional probability is multiplied by the intermediate probability calculated for the same material category in the previous feature dimension to obtain the next-level intermediate probability for the material category. ; in: This represents the intermediate probability of the current category obtained from the previous layer; This represents the joint conditional probability of the current feature and its parent feature under category C. After all feature dimensions have completed intermediate probability calculations, the final classification probability for each material category is obtained, i.e.: ; The material category with the highest final classification probability among all material categories is selected as the recognition result, and the feature vector to be identified and the recognition result are output.

[0026] In this embodiment, S4 specifically includes: S41. Read each structured feature vector, corresponding imaging parameters, and recognition result label from the training dataset. Use the structured feature vector as a covariate for causal inference, the imaging parameters as a processing variable, and the recognition result label as a result variable. S42. Divide the different values ​​of the processing variable and assign the samples in the training dataset that belong to different values ​​to the corresponding sample sets. S43. In each set of processing variable samples, a portion of samples and a portion of feature dimensions are randomly selected to form sub-samples and sub-features; a portion of samples are selected from the training dataset using a random sampling method as training samples for the current decision tree, and a portion of feature dimensions are randomly selected from all feature dimensions as candidate splitting features for the current decision tree; the sample sampling ratio and feature sampling ratio are preset values. In this embodiment, the sample sampling ratio is set to 60% of all randomly selected samples rounded up, and the feature sampling ratio is set to the square root of the number of randomly selected feature dimensions rounded up. S44. Read the structured feature vectors one by one from the subsamples, calculate the splitting index under different feature dimensions at each candidate splitting position, and select the feature dimension with the best value from the splitting indexes corresponding to all candidate feature dimensions as the splitting feature of the current node; In this invention, at each candidate splitting position, a splitting index that reflects the splitting quality is calculated for all candidate feature dimensions, such as information gain, Gini index reduction, or mean squared error reduction, and the feature with the best index and corresponding threshold is selected as the candidate splitting information; In this embodiment, the Gini index reduction is used. At each candidate splitting position, the... Count the number of samples for each material category within the current node and calculate the node impurity. Divide the samples into several subsets according to the values ​​of the candidate features, count the number of samples N for each material category within each subset, calculate the impurity Gini(childk) for each subset, and sum the weighted impurities after splitting based on the proportion of samples Nk in each subset. Use the difference between the node impurity Gini(parent) before splitting and the weighted impurity after splitting as the splitting index for the candidate splitting position. The larger the splitting index value, the better the feature and splitting method. The formula for calculating the reduction of the Gini index is given below: ; S45. Based on the splitting features of the current node, the subsamples are divided into several subsets according to the different values ​​of the features. Each subset is used as a new construction branch. The splitting feature calculation and sample partitioning operation are repeated on each branch until the preset tree depth or sample number limit is reached to form a basic decision tree structure. In this embodiment, the preset tree depth is a maximum of 12 and the sample number limit is at least 20.

[0027] S46. Repeat S43 to S45 to construct several basic decision trees with different subsamples and subfeatures.

[0028] In this embodiment, S5 specifically includes: S51. When constructing the basic decision tree, select the splitting features and splitting thresholds for each candidate splitting position in the current basic decision tree, and determine the splitting information of the candidate nodes corresponding to the splitting features and splitting thresholds. S52. Send the candidate node splitting information to other basic decision trees besides the current basic decision tree. For each other basic decision tree, search in the tree structure of the other basic decision tree whether there is a feature dimension that is the same as the splitting feature in the candidate node splitting information, and find the splitting position and splitting direction of the feature dimension in the other basic decision trees. S53. Judge the search results of each other basic decision tree. If no feature dimension with the same splitting feature as the splitting feature in the splitting information of the candidate node is found in the other basic decision trees, or if the splitting position and splitting direction found are inconsistent with the splitting position and splitting direction in the splitting information of the candidate node, then mark the verification result corresponding to the other basic decision trees as failing. In this embodiment, the same splitting direction means that they are both higher than a certain threshold or both lower than a certain threshold.

[0029] S54. Statistically analyze the verification results of all other basic decision trees. If the number of basic decision trees that have passed verification reaches a preset number, then add the candidate node splitting information to the tree structure of the current basic decision tree as a new splitting node. In this embodiment, the preset number is one-third of the total number of basic decision trees. S55. If the number of verified basic decision trees does not reach the preset number, discard the candidate node splitting information, reselect new splitting features and splitting thresholds for the same candidate splitting position of the current basic decision tree, and return to S51. S56. After all nodes of the current basic decision tree have been processed, a basic decision tree structure with cross-validation is formed. The basic decision tree structure with cross-validation is combined with other basic decision tree structures with cross-validation to form a causal forest model with a multi-tree cross-validation structure.

[0030] In this embodiment, S7 specifically includes: The feature vector to be identified and the imaging parameters are input into a causal forest model with a multi-tree cross-validation structure. In each basic decision tree of the causal forest model, the feature vector to be identified and the imaging parameters are judged according to the splitting characteristics, splitting threshold and splitting direction of the tree structure until the corresponding leaf node is reached. The sample statistics in the leaf node are recorded. In this embodiment, the sample statistics recorded by the leaf node of each basic decision tree include: the number of leaf node samples, the distribution of the number of samples of each material category, the value statistics of imaging parameters, and the statistics of the identification result labels.

[0031] In the causal forest model, the statistical information of the leaf nodes of all basic decision trees is integrated, and the influence of imaging parameters on the material category identification results is numerically calculated to obtain the influence value between imaging parameters and identification performance. In this implementation, the recognition performance is defined as whether it is correct or the classification probability. In the current decision tree, the influence value is defined as the average of the performance differences under all parameter combinations. That is, it is to traverse all parameter value pairs, calculate the difference in recognition performance between each pair, and take the average as the influence value of the parameter in the current tree. The overall influence value is the average of the influence values ​​of each tree. All available imaging parameters are sorted according to their impact values, and the imaging parameter with the highest improvement in recognition performance is selected as the target imaging configuration from the sorting results. The parameters of the imaging device are set according to the target imaging configuration. The material image is re-acquired using the target imaging configuration. The acquired image is preprocessed and feature extracted. The preprocessed and feature extracted data is used as a new feature vector to be identified. S75. Re-input the new feature vector to be identified into the Naive Bayes classification model of the dependency tree to obtain the new material category identification result, and output the new feature vector to be identified and the new material category identification result. S76. When the change between the new material category identification result and the previous material category identification result is less than the preset change value, the imaging configuration selection operation ends and the final material identification model is formed; in this embodiment, the preset change value is 0.5%.

[0032] An eagle-eye material identification system based on causal reasoning according to an embodiment of the present invention includes: The data processing module is used to collect data, perform preprocessing and feature extraction operations, and form a training dataset and a feature vector to be identified. The Naive Bayes dependency tree building module is used to generate category prior information and feature conditional probability structure, and calculate feature correlation values ​​to form a feature dependency tree to build a Naive Bayes classification model based on the dependency tree. The causal forest cross-validation building module is used to generate basic decision trees containing splitting features, splitting thresholds, and splitting directions, and to perform validation using the splitting information of other basic decision trees to build a causal forest model with a multi-tree cross-validation structure. The material identification and imaging configuration optimization module is used to calculate the influence value of imaging parameters based on the causal forest model, select the target imaging configuration, and output the final material identification model by comparing the new identification result with the previous identification result.

[0033] An edge computing device stores a computer program that, when executed by a processor, enables the processor to perform an eagle-eye material identification method based on causal reasoning.

[0034] Example 1: To verify the feasibility of this invention in practice, it was applied to a material recognition and imaging optimization scenario in an automated production line. In this scenario, a large amount of material continuously passes through multiple workstations on a conveyor line. Traditional single-view, fixed-imaging-parameter recognition methods often suffer from unstable recognition, sensitivity to lighting and angle, and lack of adaptive capabilities in complex environments. This invention utilizes a multi-view eagle-eye imaging device to acquire top-view, side-view, and tilted-view images of the material, collecting imaging parameters such as exposure value, light source angle, light source brightness, camera focal length, and resolution. Information such as workstation environment brightness, background reflection characteristics, and mechanical offset are also incorporated into the structured features. A dependency-tree Naive Bayes classification model is used to fuse and analyze the multi-source features, and a causal forest model is used to quantify the impact of different imaging parameters on recognition performance. The optimal imaging configuration is then selected to achieve an iterative optimization process.

[0035] In the application process, training images of different types of materials were collected using a multi-view imaging system, constructing a training dataset that includes texture features, shape features, gradient direction features, and environmental and imaging parameter features. The dataset contains approximately 4500 complete sample data points covering 15 material categories. Each material category exhibits significant differences in shape, reflectivity, and texture. By using dependency trees to statistically analyze the correlations between features, the model can perform layer-by-layer probability inference based on parent-child feature relationships, overcoming the biases introduced by the independence assumptions of traditional Naive Bayes models.

[0036] Subsequently, a causal forest model is constructed, and a multi-tree cross-validation mechanism is used to ensure the consistency of splitting features among different decision trees, thereby improving the stability of causal inference. In the actual recognition process, the system first obtains preliminary recognition results based on the current imaging parameters. The causal forest model then calculates the impact of changes in imaging parameters on the recognition accuracy and selects the imaging configuration that theoretically offers the highest performance improvement. The system automatically adjusts the imaging device parameters, re-acquires images with the new configuration, and re-recognizes them. Finally, when the change in recognition results is less than 0.5%, the recognition is considered converged, and the final recognition model is output.

[0037] To demonstrate the actual performance of this invention, the recognition performance of the traditional fixed imaging parameter method and the imaging optimization method of this invention on the same material set was compared. The results show that the recognition accuracy of the traditional method drops significantly under conditions such as uneven lighting at the workstation and angle shift, while the recognition accuracy of this invention is improved after dynamically optimizing the imaging conditions through causal reasoning, and the model maintains stable performance under different working conditions.

[0038] The table below shows the identification data performance of eight typical materials selected under the two methods. The table clearly demonstrates that the method proposed in this invention outperforms traditional methods in multiple performance indicators, especially under changing environmental conditions.

[0039] Table 1: Comparison of data between traditional methods and the present invention

[0040] As can be seen from Table 1, the recognition performance of traditional methods decreases under conditions of significant changes in illumination and angle shifts. This indicates that traditional models with fixed imaging parameters are prone to recognition errors when external imaging conditions are unstable, and lack a compensation mechanism.

[0041] This invention quantifies the influence of causal forests on imaging parameters and then optimizes the imaging configuration, enabling the system to automatically select parameter combinations that are more suitable for the current working conditions. As a result, the recognition accuracy is improved, generally by about 8%-12% compared to traditional methods. For example, the accuracy of Class A is improved from 88.3% to 96.7%, and for Class G from 90.1% to 97.2%.

[0042] In the face of environmental changes, the performance degradation of the method described in this invention is generally only 4%-9%, which is less than the 8%-20% degradation of traditional methods, demonstrating the stronger robustness of this invention to environmental changes. The lower performance degradation of this invention compared to traditional methods indicates that the imaging parameters determined through causal reasoning solve the problem of strong environmental dependence in traditional methods.

[0043] Overall, the data in the table demonstrates that the present invention outperforms traditional methods in terms of recognition stability and accuracy improvement in complex environments, thus verifying the feasibility and practical value of the present invention.

[0044] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. An eagle-eye material identification method based on causal reasoning, characterized in that, Includes the following steps: S1. Acquire multi-view images, parameters, and workstation environment information of materials, perform preprocessing and feature extraction, and form a training dataset; S2. Based on the training dataset, establish the basic probability structure of the Naive Bayes classification model and generate category prior information and feature conditional probability structure. S3. Construct a feature dependency tree based on the correlation of features within the training dataset, and introduce the feature dependency tree into the Naive Bayes classification structure to form a Naive Bayes classification model with dependency tree. S4. Construct causal forest training data and generate multiple basic decision tree structures for causal reasoning; S5. During the generation of each decision tree, the splitting results of candidate nodes are cross-validated through other decision trees, and the splitting results that pass the validation are retained to form a causal forest model with a cross-validation structure. S6. After preprocessing and feature extraction, the image to be identified is formed into a feature vector to be identified. This vector is then input into the Naive Bayes classification model of the dependency tree, and the material category identification result is output. S7. Input the feature vector to be identified and the current imaging parameters into the causal forest model to obtain the recognition performance evaluation result. Select the target imaging configuration to re-acquire the material image and repeat the S1 to S6 operations until the recognition result converges and output the material recognition model.

2. The eagle-eye material identification method based on causal reasoning according to claim 1, characterized in that, S2 specifically includes: S21. Read each structured feature vector and its corresponding material category label from the training dataset. Count the number of samples for each material category in the training dataset. Count the total number of samples. Divide the number of samples for each material category by the total number of samples to obtain the prior probability of the corresponding material category. Establish a one-to-one correspondence between each material category and its corresponding prior probability to obtain the category prior information. S22. For each material category in the training dataset, select structured feature vectors with the same category label from the training dataset, split the structured feature vectors in order of feature dimension, and form a feature value sequence for each feature dimension under each material category. S23. Under each material category, count the number of times different values ​​appear in each feature value sequence and calculate the relative frequency to obtain the discrete feature conditional probability value. Calculate the statistical mean and variance for the continuous feature value sequence. Store each material category, each feature dimension, the corresponding discrete feature conditional probability value, and the continuous feature statistical parameters to form a feature conditional probability structure.

3. The eagle-eye material identification method based on causal reasoning according to claim 2, characterized in that, S3 specifically includes: S31. For each pair of different feature dimensions in the training dataset, read the values ​​of the two feature dimensions for each sample, count the frequency of the same value combination, and obtain the probability of the current feature dimension value. S32. For each pair of feature dimensions, iterate through all combinations of values, divide the joint probability of each combination of values ​​by the product of the probabilities of the two corresponding values, and obtain the correlation factor corresponding to the combination of values. Add up the correlation factors of all combinations of values ​​for the same feature pair to obtain the correlation value of the feature dimension. S33. Sort all feature pairs by correlation values ​​from largest to smallest. Starting from the first position of the sort, select feature pairs one by one. When selecting a new feature pair, if the new feature pair does not produce a closed loop after being merged with the existing structure, add the new feature pair to the structure until all feature dimensions are connected. S34. In the maximum correlation structure, select any feature dimension as the root feature dimension, and expand outward layer by layer along the connection relationship starting from the root feature dimension. During the expansion process, set the upper level connection feature dimension of each new feature dimension as the parent feature dimension until all feature dimensions are assigned parent-child relationships. S35. Locate the feature conditional probability of the root feature dimension under each material category, and directly use the feature conditional probability as the reference content of the conditional probability of the root feature dimension. S36. For each non-root feature dimension, in the feature conditional probability structure, traverse all combinations of values ​​of the feature dimension and the parent feature dimension, find the conditional probability value corresponding to each combination, and record the conditional probability value of each combination as the conditional probability reference content of the non-root feature dimension. S37. Integrate the prior probability of the category with the conditional probabilities of the root feature dimension and non-root feature dimensions according to the parent-child order of the feature dependency tree to form a Naive Bayes classification model of the dependency tree.

4. The eagle-eye material identification method based on causal reasoning according to claim 3, characterized in that, The operation process of the Naive Bayes classification model in S3 specifically includes: To identify the feature vector, the prior information of the category is read in the Naive Bayes classification model of the dependency tree, and the corresponding prior probability is obtained for each material category. Obtain the root feature dimension value in the feature vector to be identified, find the conditional probability of the root feature dimension under each material category from the Naive Bayes classification model of the dependency tree, and multiply the prior probability of each material category with the corresponding conditional probability to obtain the intermediate probability of the root feature dimension. Each non-root feature dimension is processed sequentially according to the parent-child relationship of the feature dependency tree. The value of the feature dimension and the value of the parent feature dimension are obtained. The conditional probability corresponding to the combination of the two values ​​under each material category is found in the Naive Bayes classification model of the dependency tree. The conditional probability is multiplied by the intermediate probability calculated for the same material category in the previous feature dimension to obtain the next layer intermediate probability of the material category. After all feature dimensions have completed intermediate probability calculations, the final classification probability for each material category is obtained. The material category with the highest final classification probability among all material categories is selected as the recognition result, and the feature vector to be identified and the recognition result are output.

5. The eagle-eye material identification method based on causal reasoning according to claim 4, characterized in that, S4 specifically includes: S41. Read each structured feature vector, corresponding imaging parameters, and recognition result label from the training dataset. Use the structured feature vector as a covariate for causal inference, the imaging parameters as a processing variable, and the recognition result label as a result variable. S42. Divide the different values ​​of the processing variable and assign the samples in the training dataset that belong to different values ​​to the corresponding sample sets. S43. In each set of samples for processing variables, randomly select a portion of the samples and randomly select a portion of the feature dimensions to form sub-samples and sub-features. S44. Read the structured feature vectors one by one from the subsamples, calculate the split index under different feature dimensions at each candidate split position, and select the feature dimension with the best value from the split indexes corresponding to all candidate feature dimensions as the split feature of the current node. S45. Based on the splitting features of the current node, divide the subsamples into several subsets according to the different values ​​of the features. Take each subset as a new construction branch and repeat the splitting feature calculation and sample partitioning operation on each branch until the preset tree depth or sample number limit is reached to form a basic decision tree structure. S46. Repeat S43 to S45 to construct several basic decision trees with different subsamples and subfeatures.

6. The eagle-eye material identification method based on causal reasoning according to claim 5, characterized in that, S5 specifically includes: S51. When constructing the basic decision tree, select the splitting features and splitting thresholds for each candidate splitting position in the current basic decision tree, and determine the splitting information of the candidate nodes corresponding to the splitting features and splitting thresholds. S52. Send the candidate node splitting information to other basic decision trees besides the current basic decision tree. For each other basic decision tree, search in the tree structure of the other basic decision tree whether there is a feature dimension that is the same as the splitting feature in the candidate node splitting information, and find the splitting position and splitting direction of the feature dimension in the other basic decision trees. S53. Judge the search results of each other basic decision tree. If no feature dimension with the same splitting feature as the splitting feature in the splitting information of the candidate node is found in the other basic decision trees, or if the splitting position and splitting direction found are inconsistent with the splitting position and splitting direction in the splitting information of the candidate node, then mark the verification result of the other basic decision trees as failing. S54. Statistically analyze the verification results of all other basic decision trees. If the number of basic decision trees that have passed verification reaches a preset number, add the candidate node splitting information to the tree structure of the current basic decision tree as a new splitting node. S55. If the number of verified basic decision trees does not reach the preset number, discard the candidate node splitting information, reselect new splitting features and splitting thresholds for the same candidate splitting position of the current basic decision tree, and return to S51. S56. After all nodes of the current basic decision tree have been processed, a basic decision tree structure with cross-validation is formed. The basic decision tree structure with cross-validation is combined with other basic decision tree structures with cross-validation to form a causal forest model with a multi-tree cross-validation structure.

7. The eagle-eye material identification method based on causal reasoning according to claim 6, characterized in that, Specifically, S7 includes: S71. In the causal forest, perform node judgment on the features to be identified and imaging parameters, integrate the statistical information of each decision leaf node, and calculate the impact value of imaging parameters on recognition performance. S72. Sort the imaging parameters according to their influence values, select the parameter that improves the recognition performance the most as the target imaging configuration, and re-acquire images and extract new features accordingly. S73. Input the new feature vector into the dependency tree Naive Bayes model to obtain the new material identification result; S74. If the difference between the new recognition result and the previous result is less than the preset threshold, then end the imaging configuration optimization and output the final material recognition model; otherwise, continue iterating.

8. A causal reasoning-based eagle-eye material identification system, applied to the causal reasoning-based eagle-eye material identification system according to any one of claims 1 to 7, characterized in that, include: The data processing module is used to collect data, perform preprocessing and feature extraction operations, and form a training dataset and a feature vector to be identified. The Naive Bayes dependency tree building module is used to generate category prior information and feature conditional probability structure, and calculate feature correlation values ​​to form a feature dependency tree to build a Naive Bayes classification model based on the dependency tree. The causal forest cross-validation building module is used to generate basic decision trees containing splitting features, splitting thresholds, and splitting directions, and to perform validation using the splitting information of other basic decision trees to build a causal forest model with a multi-tree cross-validation structure. The material identification and imaging configuration optimization module is used to calculate the influence value of imaging parameters based on the causal forest model, select the target imaging configuration, and output the final material identification model by comparing the new identification result with the previous identification result.

9. An edge computing device, characterized in that, The edge computing device stores a computer program that, when executed by a processor, enables the processor to perform an eagle-eye material identification method based on causal reasoning, as described in any one of claims 1 to 7.