Random forest-based image classification model construction method and apparatus, and electronic device

By constructing an image classification model using multi-layer random forest groups, the problems of low efficiency and low accuracy in image classification of deep learning and wide learning systems are solved, and high-efficiency image classification results are achieved.

CN121982415APending Publication Date: 2026-05-05SHENZHEN JIUNIU YIMAO INTELLIGENT IOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-30
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In existing technologies, deep learning network models and wide learning systems suffer from low training efficiency, poor generalization ability, and low image classification accuracy in image classification.

Method used

An image classification model is constructed using a multi-layer random forest group. By integrating the feature forest layer and the enhancement forest layer, and combining the maximum correlation minimum redundancy algorithm with the iterative update of the random forest group, the model structure and feature extraction are optimized.

Benefits of technology

It improves model training efficiency, enhances the generalization ability and accuracy of image classification, and simplifies the model parameter tuning process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121982415A_ABST
    Figure CN121982415A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of computer application, and provides an image classification model construction method and device based on a random forest, electronic equipment and a storage medium, and the method comprises the steps: constructing an initial image classification model; generating a feature layer feature matrix through the feature forest layer; generating an enhancement layer feature matrix through the enhancement forest layer; inputting the feature layer feature matrix and the enhancement layer feature matrix into an output layer, and determining the prediction precision of the initial image classification model; when the prediction precision reaches a preset precision condition, determining the initial image classification model as a target image classification model; and otherwise, increasing the number of the first random forest groups and / or the second random forest groups so as to generate a target image classification model. Therefore, the image classification model is constructed by using the integrated structure of the multilayer random forest groups, the model precision is improved by increasing the number of the random forest groups, and the model training efficiency, the generalization ability and the image classification precision of the target image classification model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer application technology, and in particular relates to a method, apparatus, electronic device, computer-readable storage medium and computer program product for constructing an image classification model based on random forest. Background Technology

[0002] Image classification is a core task in computer vision, aiming to assign predefined category labels to images. It is a fundamental technology for numerous intelligent applications, such as automatic organization of mobile phone photos, social media content moderation, medical image-assisted diagnosis, and environmental perception for autonomous vehicles—all of which rely on efficient and accurate image classification.

[0003] In related technologies, image classification can be achieved by training deep learning network models or wide learning systems. However, deep learning network models are complex in structure and have numerous parameters, which may require training for days or even weeks. Furthermore, hyperparameters such as learning rate, number of iterations, initialization method, and network depth / width have a significant impact on the training results. The parameter tuning process is cumbersome and requires extensive experience. Moreover, deep learning network models cannot effectively perform incremental learning on new data. Wide learning systems generate feature nodes through random mapping, which may lead to feature redundancy. Additionally, incremental learning of new nodes in wide learning systems is prone to information loss, thus affecting the model's generalization ability and image classification accuracy. Therefore, image classification using existing technologies suffers from low model training efficiency, poor generalization ability, and low image classification accuracy. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, electronic device and computer-readable storage medium for constructing an image classification model based on random forest, which can solve the problems of low model training efficiency, poor generalization ability and low image classification accuracy caused by using deep learning network models or wide learning systems to achieve image classification in related technologies.

[0005] In a first aspect, embodiments of this application provide a method for constructing an image classification model based on random forest, comprising: constructing an initial image classification model according to a preset number of first random forest groups T and a preset number of second random forest groups M, wherein the initial image classification model includes an input layer, a feature forest layer, an augmentation forest layer and an output layer, the feature forest layer includes T first random forest groups, the augmentation forest layer includes M second random forest groups, and T and M are both positive integers; inputting a first training set into each of the first random forest groups of the feature forest layer to generate a feature matrix of the feature layer, wherein the first training set is generated by the input layer based on multiple training samples; and inputting the feature matrix of the feature layer and the first training set into... Each second random forest group in the enhanced forest layer generates an enhanced layer feature matrix. The feature matrix of the feature layer and the enhanced layer feature matrix are input to the output layer to determine the prediction accuracy of the initial image classification model. If the prediction accuracy of the initial image classification model reaches the preset accuracy condition, the initial image classification model is determined as the target image classification model. If the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, the initial image classification model is iteratively updated by increasing the number of the first random forest group and / or the second random forest group until the updated initial image classification model reaches the preset accuracy condition, and the updated initial image classification model is determined as the target image classification model.

[0006] In one possible implementation of the first aspect, each of the aforementioned first random forest groups includes P first random forests, where P is a positive integer, and each first random forest includes at least one decision tree. The process of inputting the first training set into each of the first random forest groups of the feature forest layer to generate the feature layer feature matrix includes:

[0007] Input the first training set into each of the first random forests; By sampling the first training set at least once from the p-th first random forest in the t-th first random forest group, first training subsets are generated for training each decision tree in the p-th first random forest, where... , ; The prediction matrix corresponding to the p-th first random forest in the t-th first random forest group is generated by using the p-th first random forest in the t-th first random forest group and the first training subsets corresponding to the p-th first random forest in the t-th first random forest group. Based on the prediction matrices corresponding to each first random forest in the t-th first random forest group, generate the feature matrix corresponding to the t-th first random forest group; The feature matrices corresponding to each of the first random forest groups are concatenated to generate the feature layer feature matrix.

[0008] Optionally, in another possible implementation of the first aspect, the first training set includes first sample features corresponding to multiple training samples, the feature layer feature matrix includes feature layer prediction vectors corresponding to each training sample, each second random forest group includes Q second random forests, where Q is a positive integer, and each second random forest includes at least one decision tree. The process of inputting the feature layer feature matrix and the first training set into each second random forest group of the augmented forest layer to generate the augmented layer feature matrix includes: The first sample feature corresponding to each training sample is concatenated with the feature layer prediction vector to generate the second sample feature corresponding to each training sample. Based on the maximum correlation minimum redundancy algorithm, the features of each second sample are filtered to generate the third sample features corresponding to each training sample. Based on the features of each third sample, a second training set is constructed; Input the second training set into each of the second random forests; By sampling the second training set at least once from the q-th second random forest within the m-th second random forest group, separate second training subsets are generated for training each decision tree in the q-th second random forest. , ; The prediction matrix corresponding to the qth second random forest in the mth second random forest group is generated by using the qth second random forest in the mth second random forest group and the corresponding second training subsets of the qth second random forest in the mth second random forest group. Based on the prediction matrices corresponding to each second random forest in the m-th second random forest group, generate the feature matrix corresponding to the m-th second random forest group; The feature matrices corresponding to each of the second random forest groups are concatenated to generate the enhancement layer feature matrix.

[0009] Optionally, in another possible implementation of the first aspect, the first training set includes at least one training sample corresponding to each real label, and the feature matrix of the feature layer and the feature matrix of the enhancement layer are input to the output layer to determine the prediction accuracy of the initial image classification model, including: Based on the feature matrix of the feature layer, the feature matrix of the enhancement layer, and each real label, generate the connection weights between the output layer and the feature forest layer and the enhancement forest layer. The prediction accuracy is determined by processing the feature matrix of the feature layer, the feature matrix of the enhancement layer, and the connection weights through the output layer.

[0010] Optionally, in another possible implementation of the first aspect, the above-mentioned iterative update of the initial image classification model by increasing the number of the first random forest group and / or the second random forest group includes: If the total number of second random forest groups added to the enhanced forest layer reaches a preset increment threshold, the first random forest group is iteratively added to the feature forest layer by a second preset number to iteratively update the updated initial image classification model again.

[0011] Optionally, in another possible implementation of the first aspect, the aforementioned preset accuracy condition is that the prediction accuracy is greater than or equal to a preset accuracy threshold.

[0012] Secondly, this application also provides an image classification model construction device based on random forest, comprising: a construction module, used to construct an initial image classification model according to a preset number of first random forest groups T and a preset number of second random forest groups M, wherein the initial image classification model includes an input layer, a feature forest layer, an augmentation forest layer and an output layer, the feature forest layer includes T first random forest groups, the augmentation forest layer includes M second random forest groups, and T and M are both positive integers; a first generation module, used to input a first training set into each of the first random forest groups of the feature forest layer to generate a feature matrix of the feature layer, wherein the first training set is generated by the input layer based on multiple training samples; and a second generation module, used to input the feature matrix of the feature layer and the first training set into the augmentation forest layer respectively. Each second random forest group in the forest layer generates an enhancement layer feature matrix; a first determining module is used to input the feature layer feature matrix and the enhancement layer feature matrix into the output layer to determine the prediction accuracy of the initial image classification model; a second determining module is used to determine the initial image classification model as the target image classification model if the prediction accuracy of the initial image classification model reaches a preset accuracy condition; a third determining module is used to iteratively update the initial image classification model by increasing the number of the first random forest group and / or the second random forest group if the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, until the updated initial image classification model reaches the preset accuracy condition, and then determine the updated initial image classification model as the target image classification model.

[0013] In one possible implementation of the second aspect, each of the aforementioned first random forest groups includes P first random forests, where P is a positive integer, and each first random forest includes at least one decision tree; correspondingly, the aforementioned first generation module includes: The first input unit is used to input the first training set into each of the first random forests; The first generation unit is used to sample the first training set at least once from the p-th first random forest in the t-th first random forest group, and generate first training subsets for training each decision tree in the p-th first random forest, where... , ; The second generation unit is used to generate the prediction matrix corresponding to the p-th first random forest in the t-th first random forest group by using the p-th first random forest in the t-th first random forest group and each first training subset corresponding to the p-th first random forest in the t-th first random forest group. The third generation unit is used to generate the feature matrix corresponding to the t-th first random forest group based on the prediction matrix corresponding to each first random forest in the t-th first random forest group. The fourth generation unit is used to concatenate the feature matrices corresponding to each of the first random forest groups to generate the feature layer feature matrix.

[0014] Optionally, in another possible implementation of the second aspect, the first training set includes first sample features corresponding to multiple training samples, the feature layer feature matrix includes feature layer prediction vectors corresponding to each training sample, each second random forest group includes Q second random forests, where Q is a positive integer, and each second random forest includes at least one decision tree; correspondingly, the second generation module includes: The fifth generation unit is used to concatenate the first sample features corresponding to each training sample with the feature layer prediction vector to generate the second sample features corresponding to each training sample. The sixth generation unit is used to filter the features of each second sample based on the maximum correlation minimum redundancy algorithm and generate the third sample features corresponding to each training sample. The building unit is used to construct a second training set based on the features of each third sample; The second input unit is used to input the second training set into each of the second random forests; The seventh generation unit is used to sample the second training set at least once from the q-th second random forest in the m-th second random forest group, and generate each second training subset for training each decision tree in the q-th second random forest, where, , ; The eighth generation unit is used to generate the prediction matrix corresponding to the qth second random forest in the mth second random forest group and each second training subset corresponding to the qth second random forest in the mth second random forest group. The ninth generation unit is used to generate the feature matrix corresponding to the m-th second random forest group based on the prediction matrix corresponding to each second random forest in the m-th second random forest group. The tenth generation unit is used to concatenate the feature matrices corresponding to each of the second random forest groups to generate the enhancement layer feature matrix.

[0015] Optionally, in another possible implementation of the second aspect, the first training set includes at least one training sample corresponding to each real label; correspondingly, the first determining module includes: The eleventh generation unit is used to generate the connection weights between the output layer, the feature forest layer, and the enhancement forest layer based on the feature matrix of the feature layer, the feature matrix of the enhancement layer, and each real label. The first determining unit is used to process the feature matrix of the feature layer, the feature matrix of the enhancement layer, and the connection weights through the output layer to determine the prediction accuracy.

[0016] Optionally, in another possible implementation of the second aspect, the third determining module mentioned above includes: The update unit is used to iteratively add a second preset number of first random forest groups to the feature forest layer when the total number of second random forest groups added to the enhanced forest layer reaches a preset increment threshold, so as to iteratively update the updated initial image classification model again.

[0017] Optionally, in another possible implementation of the second aspect, the aforementioned preset accuracy condition is that the prediction accuracy is greater than or equal to a preset accuracy threshold.

[0018] Thirdly, this application also provides an electronic device. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement any of the implementations of the first aspect described above.

[0019] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method of any of the implementations of the first aspect described above.

[0020] Fifthly, this application also provides a computer program product that, when run on an electronic device, causes the electronic device to execute any of the implementation methods of the first aspect described above.

[0021] The beneficial effects of this application embodiment compared with the prior art are as follows: by using the ensemble structure of multi-layer random forest groups to construct an image classification model, the model structure is simplified, the model training efficiency is guaranteed, and the output of the feature forest layer and the original training set are jointly input into the augmentation forest layer. Furthermore, by increasing the number of random forest groups, the model accuracy is improved, thereby enhancing the generalization ability and image classification accuracy of the target image classification model. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating an embodiment of the image classification model construction method based on random forest provided in this application; Figure 2 This is a schematic diagram of the process for generating a feature matrix of a feature layer according to an embodiment of this application; Figure 3 This is a schematic diagram of the process for generating the feature matrix of the enhancement layer according to an embodiment of this application; Figure 4 This is a schematic diagram of the process for updating the initial image classification model according to an embodiment of this application; Figure 5 This is a schematic diagram of the structure of the image classification model construction device based on random forest provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0024] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0025] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0026] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0027] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0028] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0029] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0030] Image classification is a core task in computer vision, aiming to assign predefined category labels to images. It is a fundamental technology for numerous intelligent applications, such as automatic organization of mobile phone photos, social media content moderation, medical image-assisted diagnosis, and environmental perception for autonomous vehicles—all of which rely on efficient and accurate image classification.

[0031] Image classification can be achieved by training deep learning network models. However, deep learning network models are complex and have numerous parameters, relying primarily on backpropagation and gradient descent for iterative optimization. This can take days or even weeks to train and requires significant computational resources. Furthermore, hyperparameters such as learning rate, number of iterations, initialization method, and network depth / width have a substantial impact on the training results. The parameter tuning process is tedious and requires extensive experience. Moreover, deep learning network models cannot effectively perform incremental learning or adaptive updates to new data, resulting in low training efficiency and poor generalization ability.

[0032] Alternatively, image classification can be achieved using a width learning system. However, since the feature nodes of a width learning system are generated through random mapping, there may be feature redundancy between feature nodes. Furthermore, the newly added nodes in the incremental learning of a width learning system are prone to information loss, which affects the generalization ability of the model and the accuracy of image classification.

[0033] Therefore, when using existing technologies to achieve image classification, there are problems such as low model training efficiency, poor generalization ability, and low image classification accuracy.

[0034] Based on this, this application provides a method, apparatus, electronic device, storage medium, and computer program for constructing an image classification model based on random forest.

[0035] The following description, with reference to the accompanying drawings, details the method, apparatus, electronic device, storage medium, and computer program for constructing an image classification model based on random forest provided in this application.

[0036] Figure 1 The illustration shows a flowchart of an image classification model construction method based on random forest provided in an embodiment of this application.

[0037] Step 101: Construct an initial image classification model based on the preset number of first random forest groups T and the preset number of second random forest groups M. The initial image classification model includes an input layer, a feature forest layer, an augmentation forest layer and an output layer. The feature forest layer includes T first random forest groups and the augmentation forest layer includes M second random forest groups. T and M are both positive integers.

[0038] It should be noted that the image classification model construction method based on random forest in this application embodiment can be executed by the image classification model construction device based on random forest in this application embodiment. The image classification model construction device based on random forest in this application embodiment can be configured in any electronic device to execute the image classification model construction method based on random forest in this application embodiment.

[0039] As one possible implementation, firstly, the number of first random forest groups T, the number of second random forest groups M, the number of first random forests in each first random forest group P, and the number of second random forests in each second random forest group Q can be preset. Then, an initial image classification model including an input layer, a feature forest layer, a reinforcement forest layer, and an output layer can be constructed based on the preset data. Specifically, the feature forest layer can include T first random forest groups, and each first random forest group can include P first random forests; the reinforcement forest layer can include M second random forest groups, and each second random forest group can include Q second random forests, where T, M, Q, and P are all positive integers.

[0040] Step 102: Input the first training set into each of the first random forest groups of the feature forest layer to generate the feature matrix of the feature layer.

[0041] The first training set can be generated by the input layer based on multiple training samples.

[0042] In one possible implementation of this application, the sample features and real labels of multiple training samples can be input into the input layer. The input layer processes the sample features and real data of each training sample to generate a first training set. ,in ( (where is an integer greater than 1) represents the number of training samples. ( (where is an integer greater than 1) represents the number of first-sample features corresponding to each training sample. ( (A positive integer) represents the number of possible class labels for the training sample. express training samples The first sample feature, express training samples A real label.

[0043] Next, the first training set can be input into each of the first random forest groups in the feature forest layer. A prediction matrix corresponding to the first training set can be generated through each first random forest group. The prediction matrices generated by each first random forest group can be combined to generate the feature matrix of the feature layer.

[0044] Optionally, each first random forest group includes P first random forests, and each first random forest includes at least one decision tree. Step 102 above may include: Input the first training set into each of the first random forests; The first training set is sampled at least once from the p-th first random forest in the t-th first random forest group to generate the first training subsets for training each decision tree in the p-th first random forest, where t and p are positive integers. , ; The prediction matrix corresponding to the p-th first random forest in the t-th first random forest group is generated by using the p-th first random forest in the t-th first random forest group and the first training subsets corresponding to the p-th first random forest in the t-th first random forest group. Based on the prediction matrices corresponding to each first random forest in the t-th first random forest group, generate the feature matrix corresponding to the t-th first random forest group; The feature matrices corresponding to each of the first random forest groups are concatenated to generate the feature layer feature matrix.

[0045] In one possible implementation, such as Figure 2 As shown in the figure (RF represents the first random forest), each first random forest can include J ( Let J be the number of decision trees (where J is an integer). The first training set can be input into P first random forests within T first random forest groups. Each first random forest can then perform J sampling operations on the first training set, for example, using the Bootstrap sampling algorithm and the Random Subspace Method (RSM) sampling algorithm, thereby generating J first training subsets for training the J decision trees in each first random forest. As an example, let the t-th decision tree (where t is a positive integer, and J is a random forest) be the first training set. In the first random forest group, the p-th (p is a positive integer, and) Taking the first random forest as an example, the j-th (j is an integer, and) The first training subset can be represented as:

[0046] in, and These represent the Bootstrap and RSM sampling algorithms, respectively. This represents the Bootstrap sampling probability. Each first random forest can construct a multi-decision tree model using Bootstrap and RSM, utilizing information gain as the splitting criterion for each decision tree, and then integrating them in parallel. Each decision tree can indirectly determine the importance of each first sample feature to the prediction result through its splitting process, thereby generating prediction matrices for each category for each training sample. That is, each first random forest can generate the corresponding prediction matrix based on its corresponding first training subsets. Assume... Let represent the mapping relationship between the input and output of each first random forest in the feature forest layer. Then, the prediction matrix of the p-th first random forest in the t-th first random forest group can be expressed as: The feature matrix corresponding to the p-th first random forest It can be represented as:

[0047] in, It is a non-linear activation function. This is the bias term. The feature matrix corresponding to the t-th first random forest group. Based on the feature matrices corresponding to the P first random forests in the t-th first random forest group, The result is obtained by piecing together, that is =[ Next, the feature matrices corresponding to the T first random forest groups can be... The features are concatenated to generate the feature matrix of the feature layer. ,in, .

[0048] Step 103: Input the feature matrix of the feature layer and the first training set into each of the second random forest groups of the augmented forest layer to generate the feature matrix of the augmented layer.

[0049] In one possible implementation of this application, to minimize information loss during the image classification process, a fully connected strategy can be employed between the feature forest layer and the augmentation forest layer. That is, the feature matrix output by the feature forest layer can be fully connected. and the first training set Each input is placed into a second random forest group of the augmented forest layer. A prediction matrix corresponding to the first training set can be generated from each second random forest group. The prediction matrices generated by each second random forest group can be combined to generate the feature matrix of the augmented layer.

[0050] Optionally, the first training set includes first sample features corresponding to multiple training samples, the feature layer feature matrix includes feature layer prediction vectors corresponding to each training sample, and each second random forest group includes Q second random forests, where Q is a positive integer. Each second random forest includes at least one decision tree. The feature layer feature matrix and the first training set are respectively input into each second random forest group of the augmentation forest layer to generate the augmentation layer feature matrix, including: The first sample feature corresponding to each training sample is concatenated with the feature layer prediction vector to generate the second sample feature corresponding to each training sample. Based on the maximum correlation minimum redundancy algorithm, the features of each second sample are filtered to generate the third sample features corresponding to each training sample. Based on the features of each third sample, a second training set is constructed; Input the second training set into each of the second random forests; By sampling the second training set at least once from the q-th second random forest within the m-th second random forest group, separate second training subsets are generated for training each decision tree in the q-th second random forest. , ; The prediction matrix corresponding to the qth second random forest in the mth second random forest group is generated by using the qth second random forest in the mth second random forest group and the corresponding second training subsets of the qth second random forest in the mth second random forest group. Based on the prediction matrices corresponding to each second random forest in the m-th second random forest group, generate the prediction matrix corresponding to the m-th second random forest group; The feature matrices corresponding to each of the second random forest groups are concatenated to generate the enhancement layer feature matrix.

[0051] As one possible implementation, such as Figure 3 As shown, the first sample features corresponding to each training sample can be concatenated with the feature layer prediction vector to generate the second sample features corresponding to each training sample. The matrix composed of the second sample features of all training samples can then be represented as follows: .

[0052] Next, the maximum relevance minimum redundancy (MRMR) algorithm can be used to filter each second sample feature, generating third sample features corresponding to each training sample. As an example, let's assume the set of second sample features in G is represented by A. We can calculate the relationship between all second sample features in A and the class label. The mutual information is calculated using the following formula:

[0053] Where |A| represents the number of second sample features in A. Indicates the features of the second sample With category labels Mutual information between them.

[0054] Next, the mutual information of all second sample feature pairs in A, i.e., the minimum redundancy, can be calculated using the following formula:

[0055] Based on the above formula, considering the relevance and redundancy of each second sample feature in A, the second sample feature with the highest MRmr value can be selected. The calculation formula is as follows:

[0056] For each training sample, you can select samples that are highly correlated with the class label and have low redundancy with the features of other second samples. Each second sample feature can be used as a third sample feature for the training sample. A second training set can be constructed based on the third sample features of each training sample and the corresponding true label, which can be represented as... In this way, the MRMR algorithm can reduce unnecessary image features and avoid feature similarity and redundant information caused by improper parameter settings in the model.

[0057] In one possible implementation of this application, each second random forest may include V( Let there be (V, where V is an integer) decision trees. The second training set can be input into Q second random forests within M second random forest groups. Each second random forest can then perform V sampling operations on the second training set, for example, using the Bootstrap sampling algorithm and the Random Subspace Method (RSM) sampling algorithm, thereby generating V second training subsets for training the V decision trees in each second random forest. As an example, let the m-th decision tree (where m is a positive integer, and...) be an integer. In the second random forest group, the q-th (q is a positive integer, and) Taking the second random forest as an example, the v-th (v is an integer, and) The second training subset can be represented as:

[0058] in, and These represent the Bootstrap and RSM sampling algorithms, respectively.

[0059] Next, each second random forest can generate a corresponding prediction matrix based on its respective second training subset. Assume... Let represent the mapping relationship between the input and output of each second random forest in the enhanced forest layer. Then, the prediction matrix of the q-th second random forest in the m-th second random forest group can be expressed as: The feature matrix corresponding to the q-th second random forest It can be represented as:

[0060] in, It is a non-linear activation function. This is the bias term. The feature matrix corresponding to the m-th second random forest group. Based on the feature matrices corresponding to the Q second random forests in the m-th second random forest group, The result is obtained by piecing together, that is = Next, the feature matrices corresponding to the M second random forest groups can be... The features are concatenated to generate the enhancement layer feature matrix. ,in, .

[0061] Step 104: Input the feature matrix of the feature layer and the feature matrix of the enhancement layer into the output layer to determine the prediction accuracy of the initial image classification model.

[0062] In one possible implementation of this application, the feature matrix of the feature layer can be... and the feature matrix of the enhancement layer In the input-output layer, the final prediction matrix for each training sample is generated through the output layer, and the final prediction matrix is ​​compared with the true label of each training sample through the output layer to generate the prediction accuracy of the initial image classification model.

[0063] Optionally, the first training set includes at least one training sample corresponding to each real label, and step 104 above may include: Based on the feature matrix of the feature layer, the feature matrix of the enhancement layer, and each real label, generate the connection weights between the output layer and the feature forest layer and the enhancement forest layer. The prediction accuracy is determined by processing the feature matrix of the feature layer, the feature matrix of the enhancement layer, and the connection weights through the output layer.

[0064] As one possible implementation, it is possible to make [ Connection weights between the output layer, the feature forest layer, and the enhanced forest layer It can be represented as:

[0065] in, The matrix representing the true labels of each training data point. for The transpose of .

[0066] The output layer can generate the prediction matrix of the initial image classification model according to the following formula. :

[0067] Next, the output layer can and By comparison, the prediction accuracy of the initial image classification model is determined.

[0068] Step 105: If the prediction accuracy of the initial image classification model reaches the preset accuracy condition, the initial image classification model is determined as the target image classification model.

[0069] In one possible implementation, it can be determined whether the prediction accuracy of the initial image classification model reaches a preset accuracy condition. For example, the preset accuracy condition can be that the prediction accuracy is greater than or equal to a preset accuracy threshold. That is, when the prediction accuracy of the initial image classification model is greater than or equal to the preset accuracy threshold, the initial image classification model can be determined as the target image classification model.

[0070] Step 106: If the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, the initial image classification model is iteratively updated by increasing the number of the first random forest group and / or the second random forest group until the updated initial image classification model reaches the preset accuracy condition, and the updated initial image classification model is determined as the target image classification model.

[0071] As one possible implementation of this application, when the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, the initial image classification model can be iteratively updated by adding a preset number of second random forest groups in the enhanced forest layer, so that the prediction accuracy of the initial image classification model reaches the preset accuracy condition, and the updated initial image classification model is determined as the target image classification model.

[0072] As an example, suppose one second random forest group is added to the augmented forest layer. Then the augmented forest layer includes a total of M+1 second random forest groups. The v-th second training subset used to train the v-th decision tree in the q-th second random forest of the M+1-th second random forest group can be represented as:

[0073] The updated augmented forest layer's feature matrix can be represented as:

[0074] in, It can be represented as:

[0075] in, (q=1,2,...,Q) can be represented as:

[0076] Therefore, the updated initial image classification model corresponds to It can be represented as:

[0077] The pseudoinverse can be represented as:

[0078] in, and They are represented as follows:

[0079]

[0080]

[0081] Then update the connection weights of the initial image classification model It can be represented as: =

[0082] In this way, by finding pseudo-inverse This reduces the computational complexity of updating the model.

[0083] The prediction matrix of the updated initial image classification model It can be represented as:

[0084] Next, the output layer can and By comparison, the prediction accuracy of the updated initial image classification model is determined.

[0085] It should be noted that the example above, in which the number of the second random forest is 1, is merely illustrative. In actual use, the number of the second random forest added each time can be determined according to actual usage needs and application scenarios. This application embodiment does not limit this.

[0086] As one possible implementation of this application, when the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, the initial image classification model can be iteratively updated by adding a preset number of first random forest groups in the feature forest layer. This updates the prediction accuracy of the initial image classification model to the preset accuracy condition, and the updated initial image classification model is then determined as the target image classification model. This further enriches the composition of the feature forest layer, allowing more random forest sets to participate in feature decision-making. By utilizing the diverse representational capabilities of each random forest, more accurate and efficient feature extraction can be achieved, thereby improving the image classification accuracy and stability of the image classification model.

[0087] As an example, suppose one first random forest group is added to the feature forest layer. Then the feature forest layer contains a total of T+1 first random forest groups. The feature matrix of the updated augmented forest layer can be represented as:

[0088] in, It can be represented as: =[ ] in, (p=1,2,...,P) can be represented as:

[0089] Therefore, G in the above embodiments can be updated to Next, the second training set can be reconstructed using the MRMR algorithm. For details, please refer to the above embodiments. This application will not repeat them here.

[0090] Therefore, the updated initial image classification model corresponds to It can be represented as:

[0091] The pseudoinverse can be represented as:

[0092] in, and They are represented as follows:

[0093]

[0094]

[0095] Then update the connection weights of the initial image classification model It can be represented as: =

[0096] In this way, by finding pseudo-inverse This reduces the computational complexity of updating the model.

[0097] The prediction matrix of the updated initial image classification model It can be represented as:

[0098] Next, the output layer can and By comparison, the prediction accuracy of the updated initial image classification model is determined.

[0099] As one possible implementation of this application, when the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, the initial image classification model can be iteratively updated by iteratively increasing the number of first random forest groups in the feature forest layer and the number of first random forest groups in the enhancement forest layer, so that the prediction accuracy of the initial image classification model reaches the preset accuracy condition, and the updated initial image classification model is determined as the target image classification model.

[0100] As an example, such as Figure 4 As shown, assuming one first random forest group is added to the feature forest layer and one second random forest group is added to the augmentation forest layer, then the feature forest layer contains T+1 first random forest groups, and the augmentation forest layer contains M+1 second random forest groups. The updated initial image classification model then corresponds to... It can be represented as:

[0101] in, and The calculation method is the same as in the above embodiments, and will not be repeated here.

[0102] but, In (q=1,2,...,Q) can be updated to:

[0103] in, It is the third sample feature corresponding to each training sample in the second training set, which is regenerated based on the feature layer feature matrix generated by the updated feature forest layer.

[0104] The pseudoinverse can be represented as:

[0105] in, and They are represented as follows:

[0106]

[0107]

[0108] Then update the connection weights of the initial image classification model It can be represented as: =

[0109] In this way, by finding pseudo-inverse This reduces the computational complexity of updating the model.

[0110] The prediction matrix of the updated initial image classification model It can be represented as:

[0111] Next, the output layer can and By comparison, the prediction accuracy of the updated initial image classification model is determined.

[0112] Optionally, the iterative update of the initial image classification model by increasing the number of the first random forest group and / or the second random forest group may include: If the total number of second random forest groups added to the enhanced forest layer reaches a preset increment threshold, the first random forest group is iteratively added to the feature forest layer by a second preset number to iteratively update the updated initial image classification model again.

[0113] In one possible implementation, an incremental threshold can be preset. When the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, the number of second random forest groups in the augmentation forest layer can be increased first. When the total number of second random forest groups added in the augmentation forest layer reaches the preset incremental threshold, if the prediction accuracy of the updated initial image classification model still does not reach the preset accuracy condition, a preset number of first random forest groups can be iteratively added to the feature forest layer, thereby iteratively updating the updated initial image classification model again until its prediction accuracy reaches the preset accuracy condition. In this way, even if the number of second random forest groups in the augmentation forest layer reaches its upper limit and further increases cannot improve the model's prediction accuracy, increasing the number of first random forest groups in the feature forest layer can further improve the prediction accuracy of the updated initial image classification model. This avoids the increased computational complexity caused by directly increasing the number of first and second random forest groups simultaneously.

[0114] The image classification model construction method based on random forest provided in this application simplifies the model structure and ensures model training efficiency by using the ensemble structure of multi-layer random forest groups to construct the image classification model. It also inputs the output of the feature forest layer and the original training set into the augmentation forest layer and improves the model accuracy by increasing the number of random forest groups, thereby improving the generalization ability and image classification accuracy of the target image classification model.

[0115] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0116] Corresponding to the image classification model construction method based on random forest described in the above embodiments, Figure 5 The diagram shows a structural block diagram of an image classification model construction device based on random forest provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0117] Reference Figure 5 The device 50 includes: The construction module 51 is used to construct an initial image classification model based on a preset number of first random forest groups T and a preset number of second random forest groups M. The initial image classification model includes an input layer, a feature forest layer, an augmentation forest layer and an output layer. The feature forest layer includes T first random forest groups and the augmentation forest layer includes M second random forest groups. T and M are both positive integers. The first generation module 52 is used to input the first training set into each of the first random forest groups of the feature forest layer to generate the feature matrix of the feature layer, wherein the first training set is generated by the input layer based on multiple training samples; The second generation module 53 is used to input the feature matrix of the feature layer and the first training set into each of the second random forest groups of the augmented forest layer to generate the feature matrix of the augmented layer. The first determining module 54 is used to input the feature matrix of the feature layer and the feature matrix of the enhancement layer into the output layer in order to determine the prediction accuracy of the initial image classification model; The second determining module 55 is used to determine the initial image classification model as the target image classification model when the prediction accuracy of the initial image classification model reaches the preset accuracy condition. The third determining module 56 is used to iteratively update the initial image classification model by increasing the number of the first random forest group and / or the second random forest group when the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, until the updated initial image classification model reaches the preset accuracy condition, and then determine the updated initial image classification model as the target image classification model.

[0118] In practical use, the image classification model construction apparatus based on random forest provided in this application embodiment can be configured in any electronic device to execute the aforementioned image classification model construction method based on random forest.

[0119] The image classification model construction device based on random forest provided in this application simplifies the model structure and ensures model training efficiency by using the integrated structure of multi-layer random forest groups to construct the image classification model. It also inputs the output of the feature forest layer and the original training set into the augmentation forest layer and improves the model accuracy by increasing the number of random forest groups, thereby improving the generalization ability and image classification accuracy of the target image classification model.

[0120] In one possible implementation of this application, each of the aforementioned first random forest groups includes P first random forests, where P is a positive integer, and each first random forest includes at least one decision tree; correspondingly, the aforementioned first generation module 52 includes: The first input unit is used to input the first training set into each of the first random forests; The first generation unit is used to sample the first training set at least once from the p-th first random forest in the t-th first random forest group, and generate first training subsets for training each decision tree in the p-th first random forest, where... , ; The second generation unit is used to generate the prediction matrix corresponding to the p-th first random forest in the t-th first random forest group by using the p-th first random forest in the t-th first random forest group and each first training subset corresponding to the p-th first random forest in the t-th first random forest group. The third generation unit is used to generate the feature matrix corresponding to the t-th first random forest group based on the prediction matrix corresponding to each first random forest in the t-th first random forest group. The fourth generation unit is used to concatenate the feature matrices corresponding to each of the first random forest groups to generate the feature layer feature matrix.

[0121] Optionally, in another possible implementation of this application, the first training set includes first sample features corresponding to multiple training samples, the feature layer feature matrix includes feature layer prediction vectors corresponding to each training sample, each second random forest group includes Q second random forests, where Q is a positive integer, and each second random forest includes at least one decision tree; correspondingly, the second generation module 53 includes: The fifth generation unit is used to concatenate the first sample features corresponding to each training sample with the feature layer prediction vector to generate the second sample features corresponding to each training sample. The sixth generation unit is used to filter the features of each second sample based on the maximum correlation minimum redundancy algorithm and generate the third sample features corresponding to each training sample. The building unit is used to construct a second training set based on the features of each third sample; The second input unit is used to input the second training set into each of the second random forests; The seventh generation unit is used to sample the second training set at least once from the q-th second random forest in the m-th second random forest group, and generate each second training subset for training each decision tree in the q-th second random forest, where, , ; The eighth generation unit is used to generate the prediction matrix corresponding to the qth second random forest in the mth second random forest group and each second training subset corresponding to the qth second random forest in the mth second random forest group. The ninth generation unit is used to generate the feature matrix corresponding to the m-th second random forest group based on the prediction matrix corresponding to each second random forest in the m-th second random forest group. The tenth generation unit is used to concatenate the feature matrices corresponding to each of the second random forest groups to generate the enhancement layer feature matrix.

[0122] Optionally, in another possible implementation of this application, the first training set includes at least one training sample corresponding to each real label; correspondingly, the first determining module 54 includes: The eleventh generation unit is used to generate the connection weights between the output layer, the feature forest layer, and the enhancement forest layer based on the feature matrix of the feature layer, the feature matrix of the enhancement layer, and each real label. The first determining unit is used to process the feature matrix of the feature layer, the feature matrix of the enhancement layer, and the connection weights through the output layer to determine the prediction accuracy.

[0123] Optionally, in another possible implementation of this application, the third determining module 56 mentioned above includes: The update unit is used to iteratively add a second preset number of first random forest groups to the feature forest layer when the total number of second random forest groups added to the enhanced forest layer reaches a preset increment threshold, so as to iteratively update the updated initial image classification model again.

[0124] Optionally, in another possible implementation of this application, the above-mentioned preset accuracy condition is that the prediction accuracy is greater than or equal to a preset accuracy threshold.

[0125] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0126] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0127] To implement the above embodiments, this application also proposes an electronic device.

[0128] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.

[0129] like Figure 6 As shown, the above-mentioned electronic device 200 includes: The system includes a memory 210 and at least one processor 220, and a bus 230 connecting different components (including the memory 210 and the processor 220). The memory 210 stores a computer program, which, when executed by the processor 220, implements the image classification model construction method based on random forest as described in the embodiments of this application.

[0130] Bus 230 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0131] Electronic device 200 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by electronic device 200, including volatile and non-volatile media, removable and non-removable media.

[0132] Memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. Electronic device 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 260 may be used to read and write non-removable, non-volatile magnetic media (… Figure 6 Not shown; usually referred to as a "hard drive"). Although Figure 6 As not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 230 via one or more data media interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.

[0133] A program / utility 280 having a set (at least one) of program modules 270 may be stored in, for example, memory 210. Such program modules 270 include—but are not limited to—an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 270 typically perform the functions and / or methods described in the embodiments of this application.

[0134] Electronic device 200 can also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), and with one or more devices that enable a user to interact with electronic device 200, and / or with any device that enables electronic device 200 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 292. Furthermore, electronic device 200 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 293. As shown, network adapter 293 communicates with other modules of electronic device 200 via bus 230. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0135] The processor 220 performs various functional applications and data processing by running programs stored in the memory 210.

[0136] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the image classification model construction method based on random forest in this application embodiment, and will not be repeated here.

[0137] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0138] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0139] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0140] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0141] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0142] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0144] The above-described 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 constructing an image classification model based on random forest, characterized in that, include: An initial image classification model is constructed based on a preset number of first random forest groups T and a preset number of second random forest groups M. The initial image classification model includes an input layer, a feature forest layer, an augmentation forest layer and an output layer. The feature forest layer includes T first random forest groups and the augmentation forest layer includes M second random forest groups. T and M are both positive integers. The first training set is input into each of the first random forest groups of the feature forest layer to generate the feature layer feature matrix, wherein the first training set is generated by the input layer based on multiple training samples; The feature matrix of the feature layer and the first training set are respectively input into each of the second random forest groups of the augmented forest layer to generate the feature matrix of the augmented layer. The feature matrix of the feature layer and the feature matrix of the enhancement layer are input into the output layer to determine the prediction accuracy of the initial image classification model; If the prediction accuracy of the initial image classification model reaches a preset accuracy condition, the initial image classification model is determined as the target image classification model. If the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, the initial image classification model is iteratively updated by increasing the number of the first random forest group and / or the second random forest group until the updated initial image classification model reaches the preset accuracy condition, and the updated initial image classification model is determined as the target image classification model.

2. The image classification model construction method based on random forest as described in claim 1, characterized in that, Each of the first random forest groups includes P first random forests, where P is a positive integer, and each first random forest includes at least one decision tree. The step of inputting the first training set into each of the first random forest groups of the feature forest layer to generate the feature layer feature matrix includes: Input the first training set into each of the first random forests; The first training set is sampled at least once using the p-th first random forest within the t-th first random forest group to generate first training subsets for training each decision tree in the p-th first random forest, wherein... , ; The prediction matrix corresponding to the p-th first random forest in the t-th first random forest group is generated by using the p-th first random forest in the t-th first random forest group and each of the first training subsets corresponding to the p-th first random forest in the t-th first random forest group. Based on the prediction matrices corresponding to each of the first random forests in the t-th first random forest group, generate the feature matrix corresponding to the t-th first random forest group; The feature matrices corresponding to each of the first random forest groups are concatenated to generate the feature layer feature matrix.

3. The image classification model construction method based on random forest as described in claim 1, characterized in that, The first training set includes first sample features corresponding to multiple training samples, the feature layer feature matrix includes feature layer prediction vectors corresponding to each training sample, each second random forest group includes Q second random forests, where Q is a positive integer, and each second random forest includes at least one decision tree. The step of inputting the feature layer feature matrix and the first training set into each of the second random forest groups of the augmented forest layer to generate the augmented layer feature matrix includes: The first sample feature corresponding to each of the training samples is concatenated with the feature layer prediction vector to generate the second sample feature corresponding to each of the training samples. Based on the maximum correlation minimum redundancy algorithm, the features of each second sample are filtered to generate the third sample features corresponding to each of the training samples. Based on the features of each of the third samples, a second training set is constructed; Input the second training set into each of the second random forests; The second training set is sampled at least once from the q-th second random forest in the m-th second random forest group to generate second training subsets for training each decision tree in the q-th second random forest, wherein... , ; The prediction matrix corresponding to the qth second random forest in the mth second random forest group is generated by using the qth second random forest in the mth second random forest group and each of the second training subsets corresponding to the qth second random forest in the mth second random forest group. Based on the prediction matrices corresponding to each of the second random forests in the m-th second random forest group, generate the feature matrix corresponding to the m-th second random forest group; The feature matrices corresponding to each of the second random forest groups are concatenated to generate the enhancement layer feature matrix.

4. The image classification model construction method based on random forest as described in claim 1, characterized in that, The first training set includes at least one training sample corresponding to each real label. The step of inputting the feature matrix of the feature layer and the feature matrix of the enhancement layer into the output layer to determine the prediction accuracy of the initial image classification model includes: Based on the feature matrix of the feature layer, the feature matrix of the enhancement layer, and each of the real labels, the connection weights between the output layer, the feature forest layer, and the enhancement forest layer are generated; The output layer processes the feature matrix of the feature layer, the feature matrix of the enhancement layer, and the connection weights to determine the prediction accuracy.

5. The method for constructing an image classification model based on random forest as described in any one of claims 1-4, characterized in that, The step of iteratively updating the initial image classification model by increasing the number of the first random forest group and / or the second random forest group includes: If the total number of the second random forest groups added to the enhanced forest layer reaches a preset increment threshold, the first random forest groups are iteratively added to the feature forest layer by a second preset number to iteratively update the updated initial image classification model again.

6. The method for constructing an image classification model based on random forest as described in any one of claims 1-4, characterized in that, The preset accuracy condition is that the prediction accuracy is greater than or equal to the preset accuracy threshold.

7. A device for constructing an image classification model based on random forest, characterized in that, include: The construction module is used to construct an initial image classification model based on a preset number of first random forest groups T and a preset number of second random forest groups M. The initial image classification model includes an input layer, a feature forest layer, an augmentation forest layer and an output layer. The feature forest layer includes T first random forest groups and the augmentation forest layer includes M second random forest groups. T and M are both positive integers. The first generation module is used to input the first training set into each of the first random forest groups of the feature forest layer to generate the feature layer feature matrix, wherein the first training set is generated by the input layer based on multiple training samples; The second generation module is used to input the feature matrix of the feature layer and the first training set into each of the second random forest groups of the augmented forest layer to generate the feature matrix of the augmented layer. The first determining module is used to input the feature matrix of the feature layer and the feature matrix of the enhancement layer into the output layer to determine the prediction accuracy of the initial image classification model; The second determining module is used to determine the initial image classification model as the target image classification model when the prediction accuracy of the initial image classification model reaches a preset accuracy condition. The third determining module is used to iteratively update the initial image classification model by increasing the number of the first random forest group and / or the second random forest group when the prediction accuracy of the initial image classification model does not reach the preset accuracy condition, until the updated initial image classification model reaches the preset accuracy condition, and then determine the updated initial image classification model as the target image classification model.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it causes the electronic device to implement the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by an electronic device, it implements the method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, Includes a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-6.