CN116452868A - Open set identification method, device, equipment and storage medium based on isolated forest - Google Patents
Open set identification method, device, equipment and storage medium based on isolated forest Download PDFInfo
- Publication number
- CN116452868A CN116452868A CN202310375046.0A CN202310375046A CN116452868A CN 116452868 A CN116452868 A CN 116452868A CN 202310375046 A CN202310375046 A CN 202310375046A CN 116452868 A CN116452868 A CN 116452868A
- Authority
- CN
- China
- Prior art keywords
- image
- model
- open set
- isolated forest
- category
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 239000013598 vector Substances 0.000 claims abstract description 40
- 230000002159 abnormal effect Effects 0.000 claims abstract description 22
- 239000010410 layer Substances 0.000 claims description 43
- 238000012549 training Methods 0.000 claims description 20
- 230000015654 memory Effects 0.000 claims description 16
- 230000009466 transformation Effects 0.000 claims description 14
- 238000011176 pooling Methods 0.000 claims description 11
- 238000010276 construction Methods 0.000 claims description 6
- 239000002356 single layer Substances 0.000 claims description 2
- 238000004422 calculation algorithm Methods 0.000 abstract description 41
- 238000012545 processing Methods 0.000 abstract description 10
- 230000008569 process Effects 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 230000007547 defect Effects 0.000 description 8
- 238000001514 detection method Methods 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 6
- 238000010801 machine learning Methods 0.000 description 6
- 230000005856 abnormality Effects 0.000 description 5
- 238000013145 classification model Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000009467 reduction Effects 0.000 description 4
- 238000013135 deep learning Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000004913 activation Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- JEIPFZHSYJVQDO-UHFFFAOYSA-N iron(III) oxide Inorganic materials O=[Fe]O[Fe]=O JEIPFZHSYJVQDO-UHFFFAOYSA-N 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 241000282326 Felis catus Species 0.000 description 1
- 230000008485 antagonism Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 238000003066 decision tree Methods 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013401 experimental design Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/048—Activation functions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Mathematical Physics (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
Abstract
The invention provides an open set identification method, device and equipment based on an isolated forest and a storage medium, belonging to the technical field of computer vision. The open set identification method comprises the following steps: constructing an open set identification model based on an isolated forest, wherein the open set identification model comprises an image identification model and the isolated forest model; inputting an image to be identified into an image identification model to obtain a category vector and a low-dimensional representation of the image; inputting the low-dimensional representation of the image into an isolated forest model to obtain a decision path length; and removing the abnormal image by using the decision path length, and judging the category of the image by using the category vector of the image. The open set recognition algorithm provided by the invention combines the image recognition model and the isolated forest model, can reject images of unknown categories, can also recognize specific categories of normal images, and has high processing efficiency; the image recognition model can process the image data into low-dimensional data which can be processed by the isolated forest model, and can improve the efficiency, accuracy and generalization capability of the isolated forest model.
Description
Technical Field
The invention belongs to the technical field of computer vision, and particularly relates to an open set identification method, device and equipment based on an isolated forest and a storage medium.
Background
The conventional machine learning classification model belongs to a closed set recognition (Closed Set Recognition) task, and only can judge whether the known class is yes or not, and in the actual use process, unknown type data can be recognized as known data of a certain type, so that the recognition effect of the model can be greatly influenced. Corresponding to closed set identification is open set identification (Open Set Recognition), which, unlike conventional closed set identification, assumes that all test samples are from known classes, and open set identification requires a model to be able to identify samples of unknown classes at the time of testing.
The open set identification can detect and reject the sample of the unknown class, so that the open set identification can be used as a complementary algorithm of the machine learning algorithm to pre-identify and reject the unknown class data, and the machine learning classification model can be prevented from misjudging the sample of the unknown class as the sample of the known class, thereby improving the identification rate of the machine learning classification model. The open set identification can be applied to various machine learning classification tasks such as cat and dog picture identification, equipment defect appearance detection, fraudulent mail detection and the like. However, existing open set recognition algorithms are not efficient in processing image data.
Disclosure of Invention
The invention aims to solve the technical problem of providing an open set identification method, device, equipment and storage medium based on an isolated forest aiming at the defects of the prior art.
In order to solve the technical problems, the invention adopts the following technical scheme:
an open set identification method based on an isolated forest, comprising:
constructing an open set identification model based on an isolated forest, wherein the open set identification model comprises an image identification model and the isolated forest model;
inputting an image to be identified into an image identification model to obtain a category vector and a low-dimensional representation of the image;
inputting the low-dimensional representation of the image into an isolated forest model to obtain a decision path length;
and removing the abnormal image by using the decision path length, and judging the category of the image by using the category vector of the image.
Further, the construction method of the open set recognition model comprises the following steps: constructing a sample image set, constructing an image recognition model and constructing an isolated forest model.
Further, the image recognition model includes: a backbone network, a convolutional network, a full connection layer, a plurality of linear transformation layers, and a result layer.
Further, the low dimension is represented as a splice vector of all the linear transformation layer single-layer 1D pooling results.
Further, the category vector is an output of the result layer.
Further, the loss function of the image recognition model is a sigmoid function.
Further, the method for eliminating the abnormal image by utilizing the decision path length comprises the following steps: if the decision path is too short, the image is rejected.
Further, the method for judging the image category by using the category vector comprises the following steps: and comparing the category vector with a predefined threshold value, judging the category characteristics contained in the image, and outputting a judging result.
Further, the method for constructing the sample image set comprises the following steps: determining category features to be identified; collecting a sample image containing category features; each image is labeled with its contained category features as labels.
Further, the sample image set further includes: sample images without any of the class features.
An open set identification device based on an isolated forest, comprising:
an acquisition unit configured to acquire a sample image set;
the training unit is used for completing the construction and training of an open set identification model according to the sample image set, wherein the open set identification model comprises an image identification model and an isolated forest model; the image recognition model is used for acquiring the category vector of the image and the low-dimensional representation of the image, and the isolated forest model is used for acquiring the decision path length according to the low-dimensional representation of the image;
the identification unit is used for acquiring the category vector and the low-dimensional representation of the image by utilizing the image identification model, acquiring the decision path length by utilizing the isolated forest model, removing the abnormal image according to the decision path length, and judging the category of the image according to the category vector of the image.
An electronic device includes a processor and a memory; the memory is configured to store executable instructions and the processor is configured to execute the instructions to implement the identification method of any of claims 1-7.
A computer readable storage medium having instructions stored therein which, when executed, implement the identification method of any of claims 1-7.
The current common open set recognition algorithm comprises an open set recognition algorithm based on distance and an open set recognition algorithm based on reconstruction. Based on distance algorithm, whether the distance between the measurement sample and the training set data exceeds a certain threshold value is mainly measured, and the training sample coverage space, namely the data distribution space of known types is usually learned, and the data outside the space are all unknown type data. However, the open set recognition algorithm based on the distance needs to traverse the training sample set every time the sample is analyzed, so that the calculation cost is increased; some distance-based algorithms require additional collection of unknown class data, but in actual use it is difficult to collect all unknown classes of data.
The method comprises the steps of reconstructing feature data while predicting the category by using a deep learning algorithm based on a reconstruction algorithm, and then designing differences between some finger scale reconstruction features and original features, wherein the larger the differences are, the more likely the sample is the sample of an unknown category. Metrics of the open set recognition algorithm based on reconstruction are relatively difficult to define than loose, the definition of the metrics is too severe, the recognition effect of the classification model is affected, and the definition of the metrics is too much, so that recognition is missed; the reconstruction algorithm generally adopts a self-encoder to reconstruct a deep learning model such as an antagonism network, and the like, and the network has higher computational complexity and higher computational cost.
Existing open set recognition algorithms often require additional data to be collected and training to obtain an abnormal data detection model. This means that developers need to collect enough various pictures, including known and unknown categories, so the collection cost of images is high; after the deep learning network structure is designed by utilizing the image data, the accurate abnormal detection model is required to be obtained through continuous super-parameter tuning, and the super-parameter tuning requires repeated experiments and experimental design, so that a large amount of time and calculation resources are required to be consumed; since the open set recognition algorithm recognizes on unknown data, the generalization ability of the model may be limited. In addition, after the model is online, the data set and the identification model are maintained continuously according to the use feedback of the user.
For the reasons described above, the applicant has employed an isolated Forest (Isolation Forest) algorithm to construct an open set recognition model. An isolated forest is a tree-structure-based recognition algorithm in which each data point is randomly selected and partitioned in the tree until each data point is partitioned onto a leaf node, thereby forming a random binary search tree. Abnormal data points are typically more easily segmented into shallower layers of the tree than normal data points, so abnormal data points can be identified by calculating the depth (decision path length) of each data point in the tree.
Compared with the distance-based and reconstruction-based algorithms, the isolated forest algorithm has lower computational complexity and can process a large amount of data in a shorter time; the isolated forest algorithm has less assumption on data distribution, so that open set identification can be effectively performed on nonlinear or non-Gaussian distributed data; the isolated forest algorithm has certain robustness to noise data and abnormal values, and can effectively identify abnormal samples in an open set; the tree structure of the isolated forest algorithm can intuitively represent the distribution condition of data and the position of an abnormal sample, and has strong interpretability.
But the isolated forest algorithm is not suitable for processing image data because the isolated forest algorithm is designed for numerical data and the image data is a structured data. Tree-based models are typically trained on lower dimensional data, and conventional tree-based models cannot be applied in picture recognition tasks due to the ultra-high dimensions of image data. For example, a common picture with a size of 1920 x 1080 x 3 also has a dimension of about 600 ten thousand, so that the data with high dimension is not suitable for an isolated forest algorithm, and even if the image data is identified by using the isolated forest algorithm, the calculation complexity of the isolated forest model is greatly increased, and the performance of the algorithm is seriously reduced; because the isolated forest algorithm randomly selects one dimension every time when cutting the data space, if the data with extremely high dimension is processed, a large amount of dimension information is still not used after the tree is built, so that the reliability of the algorithm is reduced; high dimensional space may also have a large noise dimension or extraneous dimensions that affect tree construction.
Based on the method, an improved open set recognition algorithm is provided, firstly, a dimension reduction representation of an image is obtained by using an improved image recognition model, and then, abnormality detection is carried out by using an isolated forest model. This approach has significantly reduced computational complexity compared to distance-based or reconstruction-based open set recognition algorithms. Meanwhile, the image recognition model still has a conventional category recognition function, and can recognize a specific type of image data detected by abnormality.
Compared with the prior art, the invention has the following beneficial effects:
the open set recognition algorithm provided by the invention combines the image recognition model and the isolated forest model, can recognize images of unknown categories or abnormal images, and can also recognize specific categories of normal images. The traditional open set recognition algorithm often needs additional data to train the model so as to recognize the unknown class of images, but the invention can train on the existing data set without additional data, thereby saving the workload of a developer for maintaining the data set and the model.
The invention converts the open set identification problem into the abnormality detection problem, and uses the isolated forest algorithm to detect the abnormality. The isolated forest algorithm is an abnormality detection model based on a tree, and compared with deep learning, the parameter tuning of the isolated forest algorithm is relatively simple, and complex super-parameter tuning and training are not needed; in addition, the isolated forest algorithm only needs to traverse the tree structure to judge whether the data is an abnormal point or not, and complex matrix calculation is not needed, so that the calculation complexity is low in reasoning. Therefore, the training efficiency of the open set recognition model and the computing efficiency during recognition can be effectively improved.
The invention utilizes the set image recognition model to comprise a main network, a convolution network, a full connection layer, a plurality of linear transformation layers and a result layer. The backbone network consists of a plurality of convolution layers and a pooling layer and is used for extracting characteristic information of input image data; the convolution network comprises a convolution layer and an activation function, can carry out nonlinear transformation on the output of the main network, and enhances the expression capacity of the model; the full connection layer is used for carrying out classification or regression tasks; the linear transformation layer is used for adjusting the shape or dimension of the input image data; the result layer is the output of the image recognition model, the output result is the category vector of the image data, and specific category characteristics contained in the image data can be recognized by using the category vector.
The image recognition model also carries out 1D pooling on each linear transformation layer, the pooling result is a 2-dimensional or 3-dimensional low-dimensional vector, the low-dimensional vectors are spliced into a vector, the splicing result is a low-dimensional representation of image data, and then the low-dimensional representation of each image is used as training data of an isolated forest model. The invention outputs the image data to the isolated forest model after the dimension reduction processing, and the calculated amount of the isolated forest model can be reduced by adopting the low-dimension data, so that the calculation efficiency is improved; the image is subjected to dimension reduction processing, image data can be mapped into a lower-dimension space, and the isolated forest model is facilitated to better find abnormal points, so that the performance of the model is improved. Therefore, the invention combines the isolated forest model with the image recognition model, can improve the efficiency, accuracy and generalization capability of the isolated forest model through dimension reduction processing of the image data, can recognize unknown class images more quickly, and also improves the recognition efficiency of the open set recognition model on the image data.
Drawings
The present invention will be described in further detail with reference to the accompanying drawings.
Fig. 1: a flowchart of an identification method of embodiment 1 of the present invention;
fig. 2: the embodiment 1 of the invention constructs a flow chart of an open set recognition model based on an isolated forest;
fig. 3: the embodiment 1 of the invention is a structural schematic diagram of an image recognition model;
fig. 4: the embodiment 2 of the invention is a schematic diagram of an identification device;
fig. 5: embodiment 3 of the invention is a schematic diagram of an electronic device.
Detailed Description
For a better understanding of the present invention, the content of the present invention will be further clarified below with reference to the examples and the accompanying drawings, but the scope of the present invention is not limited to the following examples only. In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the invention may be practiced without one or more of these details.
Example 1: referring to fig. 1-3, an object of the present embodiment is to provide an open set identification method based on isolated forests.
The identification method comprises the following steps:
step S101, constructing an open set identification model based on an isolated forest, wherein the open set identification model comprises an image identification model and the isolated forest model.
Specifically, as shown in fig. 2, the method for constructing the open set recognition model based on the isolated forest comprises the following steps:
s1011, constructing a sample image set.
Firstly, determining the category characteristics which are finally required to be identified by the method, collecting sample images containing the category characteristics, and collecting the sample images which do not contain any category characteristics but are related. The images are then annotated, and the category features contained in each image are used as labels. Finally, the collected image is taken as a sample image set.
If the defect of the appearance of the device is identified, the type features of the defect to be identified, such as scratches, oil leakage, rust and the like, are determined first. Image data of equipment scratches, oil leakage, rust and the like are then collected, and additionally, equipment images without any defects are collected as defect-free type data. And labeling the device images collected in the earlier stage, and taking the defect type contained in each image as a label. Since a device may have multiple appearance defects at the same time, there may be only one or two or more defective labels in a single image, and device appearance defect identification is a multi-label identification task.
S1012, constructing an image recognition model.
The structure of the image recognition model is shown in fig. 3. The image recognition model is a convolutional neural network model and comprises a main network, a convolutional network, a full-connection layer, a plurality of linear transformation layers and a result layer which are sequentially connected.
The backbone network is composed of a plurality of convolution layers and pooling layers and is used for extracting characteristic information of input image data. Each convolution layer of the backbone network comprises a plurality of convolution kernels, each convolution kernel carries out convolution operation on input data to obtain a feature map, and the convolution kernels can extract different feature information. The pooling layer downsamples the output of the convolution layer to reduce the data volume while preserving important characteristic information. The backbone network is constructed in a stacked manner, and the output of each convolution layer and pooling layer serves as the input of the next layer to form a deep feature extraction network. Specifically, the backbone network can be constructed by using a model such as a MobileNet, a residual network and the like.
The convolution network comprises a convolution layer and an activation function, can carry out nonlinear transformation on the output of the main network, and enhances the expression capacity of the model; the convolutional network may be a multi-layer conventional convolutional network or a transducer model. The full connection layer is used for classification or regression tasks. The linear transformation layer is used to adjust the shape or dimension of the input image data. The result layer is the output of the image recognition model, and the output result is the category vector of the image data. The loss function of the image recognition model adopts a sigmoid function.
The image recognition model also carries out 1D pooling (such as MaxPooling 1D) on each linear transformation layer, the pooling result is a low-dimensional vector with 2 dimensions or 3 dimensions, the low-dimensional vectors are spliced into a vector, and the splicing result is a low-dimensional representation of the image data. Thus, the constructed image recognition model is able to obtain class vectors and low-dimensional representations of the input image data.
After the image data is input into the backbone network, the backbone network extracts the image features, the extracted image features are further processed by the convolution network and the full connection layer, and finally the final class vector of the image is obtained through multi-layer linear transformation. Meanwhile, each layer of the multi-layer linear transformation is subjected to 1D pooling, low-dimensional vectors of each layer are obtained, and the low-dimensional vectors are spliced to obtain a low-dimensional representation of an image.
After the image recognition model is built, the sample image is input into the image recognition model for training.
S1013, constructing an isolated forest model.
And calculating all images in the training sample set by using the image recognition model, obtaining a low-dimensional representation of each image, and taking the low-dimensional representation corresponding to the images as training data of the isolated forest model. The isolated forest model is composed of a plurality of binary trees randomly generated, and each node of the binary tree is a randomly selected feature and a randomly split value. The low-dimensional representation of the image is input into an isolated forest model for training, and during the training process, the model calculates the anomaly score of each sample according to the depth of the sample in the tree, and the higher the anomaly score, the more likely the sample is an anomaly point. The output of the isolated forest model is the decision path length.
The isolated forest is a machine learning algorithm for anomaly detection, is an unsupervised learning algorithm, and identifies anomalies by isolating outliers in the data. An isolated forest is a decision tree-based algorithm that randomly selects features from a given feature set, and then randomly selects a segmentation value between the maximum and minimum values of the features to isolate outliers. The random division of such features may make the paths that the outlier data points generate in the tree shorter, separating them from other data.
The constructed image recognition model and the isolated forest model jointly form an open set recognition model, wherein the image recognition model is used for recognizing image category characteristics, and the isolated forest model is used for judging abnormal category characteristics.
Step S102, inputting the image to be identified into an image identification model to acquire a category vector and a low-dimensional representation of the image.
When the open set identification is needed for a certain image, the image is input into an image identification model, and the category vector and the low-dimensional representation of the image are obtained.
Step S103, inputting the low-dimensional representation of the image into the isolated forest model to obtain the decision path length.
A low-dimensional representation of an image is input into an isolated forest model, and a dependent path length of the image is acquired.
Step S104, the image category is identified by using the decision path length and the category vector of the image.
If the decision path is too short, the low dimension of the image is expressed as abnormal data, which indicates that the image does not include the category characteristics determined in step S1011, belongs to an abnormal image, and does not perform subsequent category characteristic recognition and category output for the abnormal image.
If the decision path is too long, it is stated that the image contains known class features. And comparing the category vectors of the images with a predefined threshold value, judging which category features are specifically contained in the images, outputting a judging result, and outputting the identified category features.
Example 2: referring to fig. 4, an object of the present embodiment is to provide an open set recognition apparatus based on an isolated forest for performing the open set recognition method based on an isolated forest as in embodiment 1. The identification device 200 includes: an acquisition unit 201, a training unit 202 and an identification unit 203.
The acquisition unit 201 is configured to acquire a sample image set; the sample image set stores sample images containing the category characteristics to be identified and sample images not containing the category characteristics to be identified; the sample image is tagged with the category features it contains. Specifically, the acquisition unit 201 is configured to execute step S1011.
The training unit 202 is configured to complete construction and training of an open set recognition model according to the sample image set, where the open set recognition model includes an image recognition model and an isolated forest model; the image recognition model is used for acquiring the category vector of the image and the low-dimensional representation of the image, and the isolated forest model is used for acquiring the decision path length according to the low-dimensional representation of the image. Specifically, the training unit 202 is configured to perform steps S1012 and S1013.
The recognition unit 203 is configured to acquire a category vector and a low-dimensional representation of an image according to a target image by using an image recognition model; the method comprises the steps of obtaining a decision path length by using an isolated forest model according to a low-dimensional representation of an image; the method comprises the steps of removing an abnormal image according to a decision path length; for determining the category of the image based on the category vector of the image. Specifically, the identifying unit 203 is configured to perform steps S102-S104.
The specific manner in which the respective units perform the operations in the apparatus of the present embodiment has been described in detail in embodiment 1, and will not be described in detail here.
It should be understood by those skilled in the art that, for convenience and brevity, the embodiments of the apparatus are illustrated only by the division of each functional module or unit, and in practical application, the above-mentioned functional allocation may be implemented by different functional modules or units, that is, the internal structure of the apparatus is divided into different functional modules or units, so as to implement all or part of the functions described above.
Example 3: referring to fig. 5, an object of the present embodiment is to provide an electronic device 300, including at least one processor 301 and one or more memories 302 for storing instructions executable by the processor 301. The processor 301 is configured to execute the instructions in the memory 302 to implement the open set identification method based on isolated forests described in embodiment 1.
The electronic device 300 further comprises a bus 304, the processor 301 and the memory 302 being interconnected by means of the bus 304 or otherwise.
The processor 301 is a central processing unit (central processing unit, CPU), a general purpose processor network processor (network processor, NP), a digital signal processor (digital signal processing, DSP), a microprocessor, a microcontroller, a programmable logic device (programmable logic device, PLD), or any combination thereof. The processor 301 may also be any other device having processing functions, such as, without limitation, a circuit, a device, or a software module. In one example, processor 301 may include one or more CPUs, such as CPU0 and CPU1 in fig. 5.
The memory 302 may be, without limitation, a read-only memory (ROM) or other type of static storage device capable of storing static information and/or instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device capable of storing information and/or instructions, and an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a compact disc (compact disc read-only memory, CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disc storage medium or other magnetic storage device, etc.
It is noted that the memory 302 may exist separately from the processor 301 or may be integrated with the processor 301. Memory 302 may be used to store instructions or program code or some data, etc. The memory 302 may be located within the electronic device 300 or external to the electronic device 300, without limitation.
As an alternative implementation, electronic device 300 also includes a communication interface 303. The communication interface 303 is a wired interface (or port) such as a fiber optic distributed data interface (fiber distributed data interface, FDDI), gigabit ethernet interface (GE), or the like. Alternatively, the communication interface 303 is a wireless interface. The communication interface 303 may be a module, a circuit, a communication interface, or any device capable of enabling communication. The communication interface 303 is used to communicate with other devices or other communication networks, which may be ethernet, radio access network (radio access network, RAN), wireless local area network (wireless local area networks, WLAN), etc.
As an alternative implementation, electronic device 300 also includes an input device 305 and an output device 306. Illustratively, the input device 305 is a keyboard, mouse, microphone, or joystick device, and the output device 306 is a display screen, speaker (spaker), or the like.
It should be noted that the electronic device 300 may be a desktop, a laptop, a web server, a mobile phone, a tablet, a wireless terminal, an embedded device, a chip system, or a device having a similar structure as in fig. 5. Further, the constituent structure shown in fig. 5 does not constitute a limitation of the terminal device, and the electronic device 300 may include more or less components than those shown in fig. 5, or may combine some components, or may be different in arrangement of components, in addition to those shown in fig. 5.
Example 4: an object of the present embodiment is to provide a computer-readable storage medium.
All or part of the flow in the above method embodiments may be implemented by computer instructions to instruct related hardware to complete, where the program may be stored in the computer readable storage medium, and when executed, may implement the open set identification method based on isolated forests described in embodiment 1.
The computer readable storage medium may be an internal storage unit of the electronic device of embodiment 3, such as a hard disk or a memory. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card), etc. Further, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the electronic device described above. The computer-readable storage medium is used to store a computer program and other programs and data required by an electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
In connection with the several embodiments provided herein, it should be understood that the provided apparatus and methods may be embodied in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the modules or units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple modules or units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed.
In addition, in the embodiment of the present application, each functional module or unit may be integrated in one unit, or each module or unit may exist alone physically, or two or more modules or units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional modules.
The integrated units described above may be stored in a readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
Finally, it is noted that the above embodiments are only for illustrating the technical solution of the present invention, and that other modifications and equivalents thereof by those skilled in the art should be included in the scope of the claims of the present invention without departing from the spirit and scope of the technical solution of the present invention.
Claims (10)
1. An open set identification method based on an isolated forest is characterized by comprising the following steps of: the identification method comprises the following steps:
constructing an open set identification model based on an isolated forest, wherein the open set identification model comprises an image identification model and the isolated forest model;
inputting an image to be identified into an image identification model to obtain a category vector and a low-dimensional representation of the image;
inputting the low-dimensional representation of the image into an isolated forest model to obtain a decision path length;
and removing the abnormal image by using the decision path length, and judging the category of the image by using the category vector of the image.
2. The open set identification method based on isolated forests as claimed in claim 1, characterized in that: the construction method of the open set recognition model comprises the following steps: constructing a sample image set, constructing an image recognition model and constructing an isolated forest model.
3. The open set identification method based on isolated forests as claimed in claim 2, characterized in that: the image recognition model includes: a backbone network, a convolutional network, a full connection layer, a plurality of linear transformation layers, and a result layer.
4. The open set identification method based on isolated forests as claimed in claim 3, characterized in that: the low dimension is represented as a splice vector of all the linear transformation layer single layer 1D pooling results.
5. The open set identification method based on isolated forests as claimed in claim 3, characterized in that: the category vector is the output of the result layer.
6. The open set identification method based on isolated forests as claimed in claim 1, characterized in that: the method for eliminating the abnormal image by utilizing the decision path length comprises the following steps: if the decision path is too short, the image is rejected.
7. The open set identification method based on isolated forests as claimed in claim 1, characterized in that: the method for judging the image category by using the category vector comprises the following steps: and comparing the category vector with a predefined threshold value, judging the category characteristics contained in the image, and outputting a judging result.
8. Open set recognition device based on isolated forest, its characterized in that: comprising the following steps:
an acquisition unit configured to acquire a sample image set;
the training unit is used for completing the construction and training of an open set identification model according to the sample image set, wherein the open set identification model comprises an image identification model and an isolated forest model; the image recognition model is used for acquiring the category vector of the image and the low-dimensional representation of the image, and the isolated forest model is used for acquiring the decision path length according to the low-dimensional representation of the image;
the identification unit is used for acquiring the category vector and the low-dimensional representation of the image by utilizing the image identification model, acquiring the decision path length by utilizing the isolated forest model, removing the abnormal image according to the decision path length, and judging the category of the image according to the category vector of the image.
9. An electronic device, characterized in that: including a processor and a memory; the memory is configured to store executable instructions and the processor is configured to execute the instructions to implement the identification method of any of claims 1-7.
10. A computer-readable storage medium, characterized by: the readable storage medium having stored therein instructions which, when executed, implement the identification method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310375046.0A CN116452868A (en) | 2023-04-10 | 2023-04-10 | Open set identification method, device, equipment and storage medium based on isolated forest |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310375046.0A CN116452868A (en) | 2023-04-10 | 2023-04-10 | Open set identification method, device, equipment and storage medium based on isolated forest |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116452868A true CN116452868A (en) | 2023-07-18 |
Family
ID=87133122
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310375046.0A Pending CN116452868A (en) | 2023-04-10 | 2023-04-10 | Open set identification method, device, equipment and storage medium based on isolated forest |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116452868A (en) |
-
2023
- 2023-04-10 CN CN202310375046.0A patent/CN116452868A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110348580B (en) | Method and device for constructing GBDT model, and prediction method and device | |
CN110472082B (en) | Data processing method, data processing device, storage medium and electronic equipment | |
KR102471871B1 (en) | Method for segmenting time series data and apparatus thereof | |
CN111931809A (en) | Data processing method and device, storage medium and electronic equipment | |
KR20210038303A (en) | System and method of classifying manufactured products | |
CN113032525A (en) | False news detection method and device, electronic equipment and storage medium | |
CN113704389A (en) | Data evaluation method and device, computer equipment and storage medium | |
CN116451081A (en) | Data drift detection method, device, terminal and storage medium | |
CN117272204A (en) | Abnormal data detection method, device, storage medium and electronic equipment | |
Nguyen-Trang | A new efficient approach to detect skin in color image using Bayesian classifier and connected component algorithm | |
CN114860941A (en) | Industry data management method and system based on data brain | |
CN114492366A (en) | Binary file classification method, computing device and storage medium | |
CN116910592B (en) | Log detection method and device, electronic equipment and storage medium | |
CN113837836A (en) | Model recommendation method, device, equipment and storage medium | |
CN116109627B (en) | Defect detection method, device and medium based on migration learning and small sample learning | |
CN112949634A (en) | Bird nest detection method for railway contact network | |
CN111738290A (en) | Image detection method, model construction and training method, device, equipment and medium | |
CN116452868A (en) | Open set identification method, device, equipment and storage medium based on isolated forest | |
CN116958724A (en) | Training method and related device for product classification model | |
CN109739840A (en) | Data processing empty value method, apparatus and terminal device | |
CN111539576B (en) | Risk identification model optimization method and device | |
CN116861226A (en) | Data processing method and related device | |
CN111275135B (en) | Fault diagnosis method, device, equipment and medium | |
CN114550832A (en) | Methods, systems, and media for holistic screening of proteomic clinical biomarkers | |
JP2020101900A (en) | Image inspection apparatus, learning method for image inspection and image inspection program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |