Ancient building image rapid classification method based on random projection and stack pseudo-inverse learning

By constraining random projection blocks to a specific distribution and assigning attention weights, combined with stacked pseudo-inverse learning, the efficiency and accuracy issues in ancient building image classification are solved, achieving fast and accurate ancient building image classification.

CN120912946APending Publication Date: 2025-11-07TAIYUAN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510930516.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-07
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing methods for classifying images of ancient buildings, while improving classification accuracy, neglect classification efficiency, resulting in lengthy processes, wasted resources, and poor user experience. Furthermore, random projection blocks lack adaptability to different data, affecting the model's generalization performance.

Method used

By constraining random projection blocks to a specific distribution and assigning weights to different base learners based on an attention mechanism, combined with single-hidden-layer stacked pseudo-inverse learning, a classification model for ancient building images is constructed.

Benefits of technology

It significantly improves the efficiency and accuracy of ancient building image classification, enhances the robustness and adaptability of the model, and can quickly and accurately process ancient building images in complex scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120912946A_ABST
    Figure CN120912946A_ABST
Patent Text Reader

Abstract

The invention discloses an ancient building image rapid classification method based on random projection and stack pseudo-inverse learning, belongs to the technical field of image processing, and solves the problems that in the ancient building image classification process, due to the fact that distribution of random projection blocks in an ancient building classification model is not restrained, adaptability to data after stacking is poor, and generalization performance is reduced. Comprising the following steps: firstly, randomly giving input weight matrixes with different specific distributions for an input ancient building image, and obtaining different random projection blocks through a pseudo-inverse learning algorithm to form a base learner; then, training results of different random projection blocks serve as a new input data set, and different attention weights are given to the different random projection blocks according to the importance of the random projection blocks by introducing the idea of an attention mechanism; and finally, carrying out single-hidden-layer neural network training by using a stack pseudo-inverse learning algorithm, rapidly and accurately obtaining an ancient building image classification model, and realizing rapid and accurate classification of the ancient building images.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of image processing, and particularly relates to a fast classification method for ancient building images based on random projection and stack pseudo-inverse learning. BACKGROUND

[0002] Ancient Chinese buildings carry profound historical heritage and outstanding artistic achievements. With the rapid advancement of digitalization, ancient building image resources have exploded, with a large data size and diverse types. These massive image data provide rich materials for ancient building image classification research, but also pose strict challenges to the speed and accuracy of classification technology. At present, most ancient building image classification methods focus on improving classification accuracy, but ignore the consideration of classification efficiency, which leads to long classification process, serious resource waste and poor user experience. Therefore, how to significantly improve the classification efficiency while ensuring the classification accuracy has become a key issue to be tackled.

[0003] Pseudo-inverse learning algorithm (PIL) is a non-gradient descent algorithm that can effectively accelerate model training process by obtaining optimal solution in one step, opening up a new path for fast classification of ancient building images. To avoid the loss of classification accuracy, a stack generalization method (i.e. stack pseudo-inverse learner, SP) with good generalization performance is introduced. This method integrates multiple different base learners to reduce the bias of the generalizer to a specific data set, thereby significantly improving the accuracy of the classification model. SP can ensure classification accuracy while achieving efficient and fast classification of ancient building images.

[0004] As an ensemble learning technique, SP usually integrates multiple base learners in the form of stack generalization and uses PIL algorithm to train neural networks. However, the random projection block in SP has strong randomness and disorder, which makes it less adaptable when dealing with different data. At the same time, the influence of random projection on the classification model, whether it exists or not, and the specific way of influence, is easily overlooked. In view of this, the application will focus on giving different specific distributions to the random projection block to enhance its adaptability to various data. In addition, since different specific distributions have different effects on the classification model, how to effectively combine these random projection blocks with different specific distributions becomes the core of building a high-performance SP.

[0005] Attention mechanism (AM) as a key technology in the field of deep learning has been widely used, and its core role is to enable the model to focus on the key information in the input data, thereby significantly improving the performance and effect of the model. Based on this, the application draws lessons from the concept of attention mechanism, allocates different attention weights to different specific distribution random projection blocks according to importance, and effectively fuses them, finally realizes the rapid and accurate classification of ancient building images. SUMMARY

[0006] The main purpose of the application is to overcome the shortcomings in the prior art, provide a rapid classification method for ancient building images based on random projection and stack pseudo-inverse learning, and solve the problems of poor data adaptation performance and generalization performance after stacking due to the unconstrained distribution of random projection blocks in the ancient building classification model during the classification process of ancient building images.

[0007] The application is implemented by the following technical scheme: a rapid classification method for ancient building images based on random projection and stack pseudo-inverse learning, including three parts: first, constrain the random projection block to be a specific distribution to obtain a base learner; second, based on the idea of attention mechanism, different attention weights are allocated to different base learners according to their importance; third, the single hidden layer stack pseudo-inverse learning is used to obtain the classification result of the ancient building image. The input of the application is: M pairs of ancient building training samples X train , K pairs of test samples X test and the target label matrix T train of the training sample; the output is: the stack network output Y train during training, and the stack network output Y test during testing. Specifically, the following steps are included:

[0008] S1, constrain the random projection block to be a specific distribution to obtain a base learner;

[0009] S1-1, obtain an input weight matrix V i with different specific distributions:

[0010] Randomly generate i input weight matrices V i with different distribution types, i=1, 2 or 3; wherein V1 and V2 are normal distributions, the expected values corresponding to V1 and V2 are μ1 and μ2 respectively, and the standard deviations corresponding to V1 and V2 are δ1 and δ2 respectively; V3 is a uniform distribution in the interval [g, h];

[0011] V1 ~ N(x| μ1, δ1 2 ), V2 ~ N(x| μ2, δ2 2 ), V3 ~ U(g, h); (1)

[0012] In formula (1), N represents a normal distribution, U represents a uniform distribution, g and h are interval end values;

[0013] S1-2, the hidden layer output Htrain of the base learner in the training process i is:

[0014] Htrain i =σ(X train ×V i ); (2)

[0015] The hidden layer output Htest of the base learner in the test process i is:

[0016] Htest i =σ(X test ×V i ); (3)

[0017] In formula (2), formula (3), V i is an input weight matrix, i=1, 2 or 3; X train is a training set, X test is a test set, and sigma is a Sigmoid activation function;

[0018] S1-3, the output weight matrix W of the base learner is obtained by a pseudo-inverse learning algorithm i :

[0019]

[0020] In formula (4), i=1, 2 or 3, "+" represents pseudo-inverse operation, T train is a target label matrix of the training set, and arc(sigma) represents an activation function;

[0021] S1-4, the network output Ytrain of the base learner in the training process i is:

[0022] Ytrain i =Htrain i ×W i ; (5)

[0023] The network output Ytest of the base learner in the test process i is:

[0024] Ytest i =Htest i ×W i ; (6)

[0025] S2, different weights are allocated to different random projection blocks based on an attention mechanism; the main process is as follows:

[0026] S2-1, the network output Ytrain of the base learner in the training process is calculated i The similarity S between the target label matrix T of the training set train : i :

[0027]

[0028] In formula (7), "||Ytrain i ||" represents the norm of Ytrain i , and "||T train ||" represents the norm of T train ; i=1, 2 or 3;

[0029] S2-2, the similarity S i is processed by Sigmoid nonlinear mapping and Softmax normalization in turn to obtain the input weight matrix a i under random projection.

[0030]

[0031] In formula (8) and formula (9), a i ' is the input weight matrix under random projection obtained after Sigmoid nonlinear mapping is performed on the similarity S i ; and a i is the input weight matrix under random projection obtained after Softmax normalization is performed on a i '.

[0032] S3, determine the ancient building image classification result through single hidden layer stack pseudo-inverse learning; the single hidden layer stack pseudo-inverse learner is used for stack learning in the present application, so as to speed up the training process of the ancient building classification model.

[0033] S3-1, the random projection blocks with different weight matrices are allocated as inputs of the stack network:

[0034] The hidden layer output Htrain s after stacking in the training process is:

[0035] Htrain s =σ(tempH) (10)

[0036] The hidden layer output Htest s after stacking in the test process is:

[0037] Htest s = sigma(tempH2); (11)

[0038] In formula (10) and formula (11), sigma() is a Sigmoid activation function, and tempH and tempH2 are respectively:

[0039]

[0040] In formula (12) and formula (13), Ytrain i and Ytest i are respectively corresponding network outputs of the base learner in the training and testing processes;

[0041] S3-2, according to the pseudo-inverse learning algorithm, the output weight matrix W s of the stack is calculated as:

[0042]

[0043] In formula (14), '+' represents pseudo-inverse operation, arc(sigma) is an activation function, and Ttrain is a target label matrix of the training set;

[0044] S3-2, the stack network output Ytrain s in the training process of the ancient building classification model and the stack network output Ytest s in the testing process are respectively:

[0045] Ytrain s = Htrain s * W s ; (15)

[0046] Ytest s = Htest s * W s ; (16)

[0047] The classification result of the ancient building image is obtained, and the ancient building image rapid classification based on random projection and stack pseudo-inverse learning is completed.

[0048] Further, in the step S2-1, the similarity S i is a cosine similarity.

[0049] The beneficial effects of the present application are:

[0050] (1) The classification efficiency is improved: by combining random projection and stack pseudo-inverse learning algorithm, the complex parameter iterative optimization process is avoided, the training speed and classification reasoning speed of the ancient building image classification model are significantly accelerated, and rapid classification is realized.

[0051] (2) Improved classification accuracy: using different specific distribution input weight matrix to construct multiple random projection blocks as base learners, can extract multi-dimensional and multi-feature information from ancient building images; At the same time, the attention mechanism is introduced, and the random projection blocks with different importance are given corresponding weights, which enhances the role of key features, and finally the model is further optimized through the stack pseudo-inverse learning, which effectively improves the classification accuracy;

[0052] (3) Enhanced model robustness: the fusion of multiple base learners and the introduction of attention mechanism make the model have stronger adaptability to the noise, angle change, partial occlusion and other interference factors in ancient building images, and improve the classification stability of the model in complex scenes;

[0053] (4) Suitable for ancient building image characteristics: according to the characteristics of complex texture and diverse structure of ancient building images, this method can better capture the unique features of ancient buildings through multi-feature extraction and weight optimization, and the experiment on ancient building image dataset verifies its effectiveness for this specific image classification. BRIEF DESCRIPTION OF DRAWINGS

[0054] Figure 1 is the flow chart of the method of the present application;

[0055] Figure 2 is the comparison chart of P, R and F1 before and after the stack of random distribution algorithm. DETAILED DESCRIPTION

[0056] The present application will be further described in detail below in combination with the drawings and examples.

[0057] As shown in the ancient building image rapid classification method based on random projection and stack pseudo-inverse learning, the method comprises the following steps: Figure 1

[0058] S1, constrain the random projection block to be a specific distribution to obtain a base learner;

[0059] S1-1, obtain input weight matrix V i with different specific distributions;

[0060] Randomly generate i input weight matrices V i with different distribution types, i=1, 2 or 3; wherein V1 and V2 are normal distribution, the expectation corresponding to V1 and V2 is μ1 and μ2 respectively, and the standard deviation corresponding to V1 and V2 is δ1 and δ2 respectively; V3 is a uniform distribution in the interval [g, h];

[0061] V1~N(x|μ1,δ1 2 ), V2~N(x|μ2,δ2 2 ​), V3-U(g, h); (1)

[0062] In formula (1), N represents normal distribution, U represents uniform distribution, g and h are interval end values;

[0063] S1-2, the hidden layer output Htrain of the base learner in the training process i is:

[0064] Htrain i = σ(X train × V i ); (2)

[0065] The hidden layer output Htest of the base learner in the test process i is:

[0066] Htest i = σ(X test × V i ); (3)

[0067] In formula (2), formula (3), V i is an input weight matrix, i=1, 2 or 3; X train is a training set, X test is a test set, and σ is a Sigmoid activation function;

[0068] S1-3, the output weight matrix W of the base learner is obtained by a pseudo-inverse learning algorithm i :

[0069]

[0070] In formula (4), i=1, 2 or 3, "+" represents pseudo-inverse operation, T train is a target label matrix of the training set, and arc(σ) represents an activation function;

[0071] S1-4, the network output Ytrain of the base learner in the training process i is:

[0072] Ytrain i = Htrain i × W i ; (5)

[0073] The network output Ytest of the base learner in the test process i is:

[0074] Ytest i = Htest i × W i ; (6)

[0075] S2, different weights are assigned to different random projection blocks based on an attention mechanism;

[0076] S2-1, calculating the network output Ytrain of the base learner in the training process i and the target label matrix T of the training set train , the similarity S between them i In this embodiment, the cosine similarity is adopted:

[0077]

[0078] In formula (7), “||Ytrain i ||” represents the norm of Ytrain i , “||T train ||” represents the norm of T train ; i = 1, 2 or 3;

[0079] S2-2, the similarity S i is processed by Sigmoid nonlinear mapping and Softmax normalization in turn to obtain the input weight matrix a i under random projection;

[0080]

[0081] In formula (8) and formula (9), a i ’ is the input weight matrix under random projection obtained after Sigmoid nonlinear mapping processing of the similarity S i ; a i is the input weight matrix under random projection obtained after Softmax normalization processing of a i ’;

[0082] S3, determining the classification result of the ancient building image by single hidden layer stack pseudo-inverse learning;

[0083] S3-1, the random projection blocks with different weight matrices are assigned as the input of the stack network:

[0084] The hidden layer output Htrain after stacking in the training process s is:

[0085] Htrain s = σ (tempH) ; (10)

[0086] The hidden layer output Htest after stacking in the testing process s is:

[0087] Htest s = σ (tempH2) ; (11)

[0088] In formula (10) and formula (11), sigma () is a Sigmoid activation function, tempH and tempH2 are respectively:

[0089]

[0090] In formula (12) and formula (13), Ytrain i and Ytest i are respectively the corresponding network outputs of the base learner in the training and testing processes;

[0091] S3-2, according to the pseudo-inverse learning algorithm, the output weight matrix W s of the stack is calculated as:

[0092]

[0093] In formula (14), "+" represents pseudo-inverse operation, arc (sigma) is an activation function, and Ttrain is a target label matrix of the training set;

[0094] S3-2, the stack network output Ytrain s in the training process of the ancient building classification model and the stack network output Ytest s in the testing process are respectively:

[0095] Ytrain s = Htrain s * W s ; (15)

[0096] Ytest s = Htest s * W s ; (16)

[0097] The classification result of the ancient building image is obtained, and the rapid classification of the ancient building image based on random projection and stack pseudo-inverse learning is completed.

[0098] In this embodiment, the effectiveness of the present application is verified by experiments on the ancient building image dataset provided by the Key Laboratory of Intelligent Perception and Image Understanding of the Chinese Academy of Sciences (http: / / vision.ia.ac.cn / data). The ancient building image dataset includes 6 classes of 2269 ancient building images, including Shangqing Palace, Zixiao Palace, Jindin Temple, Zhantan Temple, Fayu Temple and Longquan Temple. In order to reduce the randomness and contingency of the ancient building classification experiment as much as possible, all experiments are done ten times, and the average classification accuracy (Mean) and standard deviation (STD) are obtained.

[0099] Figure 2 The P, R and F1 of the present application and the random distribution algorithm before and after stacking are compared on the ancient building dataset. Among them, the random distribution algorithm is to randomly generate an input weight matrix, and then use the present application algorithm for stacked pseudo-inverse learning. On the one hand, the effectiveness of the stacking model is verified by comparing the experimental results before and after stacking. On the other hand, by comparing the experimental results of the present application and the random distribution algorithm, the effectiveness of the present application in generating input weight matrices with different specific distributions can be verified. Specifically, the P, R and F1 of the present application after stacking are improved compared with the three base learners and the random distribution algorithm. The P is improved by 4.74%, 1.11% and 3.63% on average on the three base learners of the present application, and by 5.05% on average on the random distribution algorithm. The R is improved by 4.36%, 1.22% and 3.75% on average on the three base learners of the present application, and by 4.32% on average on the random distribution algorithm. The F1 is improved by 4.89%, 1.36% and 4.26% on average on the three base learners of the present application, and by 4.93% on average on the random distribution algorithm, thereby verifying the effectiveness of the present application algorithm.

[0100] Table 1 compares the average accuracy of the present application algorithm (Ours) and the random distribution algorithm (Random distribution) before and after stacking on the ancient building dataset, expressed as Mean (%) ± STD (%).

[0101] Table 1 Average accuracy before and after stacking

[0102]

[0103] As shown in Table 1, the algorithm of the present application obtains higher test accuracy. Specifically, the training accuracy reaches 100%, the average test accuracy after stacking is increased by 1.70%, 0.89% and 1.39% respectively than the three base learners of the algorithm of the present application, and is increased by 0.36% than the random distribution algorithm.

[0104] The time complexity of the algorithm of the present application is evaluated on the ancient building data set. By calculating the experimental results of ten times of ancient building image classification, the average training time is 891.31s, thereby verifying the effectiveness of the fast classification method of the present application. This benefits from the stacking generalization under random projection by using PIL, and the fast learning is performed in a non-iterative optimization manner. In most cases, only one step is needed to obtain the optimal solution, thereby effectively accelerating the training process.

[0105] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A fast classification method for ancient building images based on random projection and stack pseudo-inverse learning, characterized in that, The method comprises the following steps: S1, constraint random projection block to a specific distribution to obtain base learner; S1-1, obtaining an input weight matrix V with different specific distributions i : Randomly generate i input weight matrices V of different distribution types i , i = 1, 2 or 3; wherein, V1, V2 are normal distribution, the expectations corresponding to V1, V2 are μ1, μ2 respectively, the standard deviations corresponding to V1, V2 are δ1, δ2 respectively; V3 is a uniform distribution in the interval [g, h]; In formula (1), N represents normal distribution, U represents uniform distribution, and g and h are interval end point values; S1-2, the hidden layer output Htrain of the base learner in the training process i is: Htrain i = σ(X train × V i ); (2) The base learner's hidden layer output in the test process Htest i is: Htest i = σ(X test × V i ); (3) In formula (2), formula (3), V i is an input weight matrix, i = 1, 2 or 3; X train is a training set, X test is a test set, and sigma is a sigmoid activation function. S1-3, obtaining the output weight matrix W of the base learner through a pseudo-inverse learning algorithm i : In formula (4), i = 1, 2 or 3, "+" represents pseudo-inverse operation, T train is the target label matrix of the training set, and arc(σ) represents an activation function. S1-4, network output Ytrain of the base learner in the training process i is: Ytrain i = Htrain i x W i ; (5) The network output Ytest of the base learner during the test process i is: Ytest i = Htest i x W i ; (6) S2, based on attention mechanism, different weights are assigned to different random projection blocks; S2-1, calculating the network output Ytrain of the base learner in the training process i the similarity S between the target label matrix T of the training set train and the base learner i : In Equation (7), "||Ytrain i ||" represents a norm of Ytrain i ; "||T train ||" represents a norm of T train ; i = 1, 2, or 3. S2-2, the similarity S i Sigmoid non-linear mapping and Softmax normalization processing are sequentially adopted to obtain the input weight matrix a under random projection i ; In formula (8) and formula (9), a i is the similarity S i is the input weight matrix under random projection after processing by the Sigmoid nonlinear mapping;a i is a i is the input weight matrix under random projection after processing by the Softmax normalization. S3, determine the classification result of ancient building image through single hidden layer stack pseudo-inverse learning; S3-1, assign random projection blocks with different weight matrices as inputs of the stack network: Stacked hidden layer output Htrain during training s is: Htrain s = σ(tempH); (10) The hidden layer output after the stack during the test process is Htest s is: Htest s = σ (tempH2) ; (11) In formula (10) and formula (11), sigma() is a Sigmoid activation function, tempH and tempH2 are respectively: In formula (12) and formula (13), Ytrain i and Ytest i are the corresponding network outputs of the base learner in the training and testing processes, respectively. S3-2, according to the pseudo-inverse learning algorithm, the output weight matrix W after the stack is calculated s is: In formula (14), "+" represents pseudo-inverse operation, arc(sigma) is an activation function, and Ttrain is a target label matrix of a training set; S3-2, the stack network output Ytrain in the training process of the ancient building classification model s and the stack network output Ytest in the test process s respectively: Ytrain s = Htrain s x W s ; (15) Ytest s = Htest s x W s ; (16) The classification result of the ancient building image is obtained, and the rapid classification of the ancient building image based on random projection and stack pseudo-inverse learning is completed.

2. The fast classification method of ancient building images based on random projection and learning with pseudo-inverse of stack according to claim 1, characterized in that, In the step S2-1, the similarity S i is a cosine similarity.