An open set recognition method and system based on untrained open set simulator
Through the training-free open set simulator and the multi-transformation feature extraction model, the problem of deep learning models identifying unknown category samples in an open environment is solved, achieving higher recognition accuracy and stability, and avoiding the high resources of the generative adversarial network. need.
Patent Information
- Application Number
- CN202311730143.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2043-12-15
AI Technical Summary
Existing deep learning models are difficult to effectively identify unknown class samples when facing an open environment, and the generative adversarial network method has poor stability, high computational cost, and high resource requirements, making it impossible to generate high-quality samples without introducing a generative adversarial network. Unknown class sample.
Using a method based on a training-free open set simulator, unknown samples are generated through local degradation operation simulation, and a multi-transformation feature extraction model is constructed to extract discriminative features of known classes and unknown classes, using a feature extractor and classification based on prototype learning The machine is trained and converted from closed set training to open set training.
It improves the generalization ability and recognition accuracy of the model, enhances the ability to identify unknown categories, stability and accuracy, and can perform more stably in the face of variable and unknown data in the real world.
Smart Images

Figure CN117689951B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image classification, and in particular to an open set recognition method and system based on a non-training open set simulator. Background Art
[0002] As one of the important branches of the booming field of computer science and artificial intelligence, machine learning is an advanced computing method that uses experience. By continuously improving the performance of algorithms, machine learning can achieve accurate predictions and automatically discover meaningful patterns in data. With the continuous emergence of large-scale data in various fields of social life and industrial production, machine learning, as a mainstream artificial intelligence technology, has become the core means to achieve intelligent processing of large-scale data. In the past few decades, machine learning has become a general technology in almost all tasks that require extracting information from big data. In recent years, machine learning technology represented by deep learning has greatly promoted the development of artificial intelligence. With its powerful fitting ability, deep learning has stood out in many tasks such as classification, detection and segmentation, and has gradually been applied in commercial scenarios such as face recognition, autonomous driving, robots, intelligent dialogue, machine translation, etc., greatly improving people's quality of life and becoming an indispensable part of human life.
[0003] Generally speaking, most existing methods follow the assumption of closed data sets, that is, the data categories encountered by the model in the test set are exactly the same as those in the training set. However, in practical applications, the model is often in an open environment, that is, the test set data includes both known categories that have appeared in the training set and unknown categories that have not appeared in the training set. The appearance of unknown class samples will cause the performance of the model to decline. For example, in the vehicle recognition program, only data information of various vehicle categories is provided to the model during the training process. The model may encounter data of other categories in the actual recognition scene, such as humans, animals, etc. Due to the closed nature of the training set data, the model will also recognize categories outside the training set as certain vehicles; for example, in the face recognition task, when a model trained with a certain face data set is required to recognize a specific face, if the faces that appear are all in the training set, the model can easily identify each known face. However, when a face that does not belong to the training set appears, the model will still mistake it for a known face in the training set.
[0004] Although the impact of unknown class samples on the model can be alleviated by collecting a large amount of data of various categories, it is difficult to include all data categories in the training set because the categories in nature are difficult to enumerate. Even a large-scale dataset like ImageNet can only cover a small part of the categories in the real world and cannot completely cover all possible categories. When faced with the open environment in practical applications, the model needs a more reasonable way to handle unknown class samples, namely Open-Set Recognition (OSR). The main goal of open-set recognition is to accurately identify samples from unknown categories while correctly classifying known categories. Summary of the invention
[0005] In view of the above-mentioned problems, the present invention is proposed.
[0006] Therefore, the technical problem solved by the present invention is: the existing method of using generative adversarial networks to generate additional samples in deep learning models has poor stability, high computational cost, and high resource requirements, as well as the problem of how to generate high-quality samples of unknown categories without introducing generative adversarial networks.
[0007] To solve the above technical problems, the present invention provides the following technical solutions: an open set recognition method based on an untrained open set simulator, comprising collecting original pictures, constructing an untrained open set simulator, performing local degradation operations on known class images, and simulating the generation of unknown samples; constructing a multi-transformation feature extraction model to extract the discriminative features of known class images in the training set and the generated unknown class samples; and inputting the discriminative features into a feature extractor and classifier based on prototype learning for training.
[0008] As a preferred solution of the open set recognition method based on the untrained open set simulator described in the present invention, wherein: the simulation generation of unknown samples includes the simulation generation of unknown samples after collecting the original picture, including an unknown sample generation method based on local noise addition, an unknown sample generation method based on local erasure, and an unknown sample generation method based on local mosaic; the unknown sample generation method based on local noise addition includes taking the center point of the original input image as the center, selecting a square area with a side length of R on the image, wherein H / R and W / R take random numbers between 1.1 and 1.2, generating a noise value that obeys a Gaussian distribution with a mean of 0 and a variance of 1 in the square area, and setting the values of other areas outside the square area to 0, superimposing the local noise on the original input image, and the unknown sample generation based on local noise addition is expressed as:
[0009]
[0010] Among them, x i Represents the original input image, size H, W, Noiselocal(R) represents the local noise superimposed on the original image, K represents the total number of known categories, and K+1 represents that the label corresponding to the generated sample is an unknown category; the unknown sample generation method based on local erasure includes setting the side length of the local square area to be erased to R, H / R and W / R are random numbers between 1.5 and 2, setting the pixels of the square area to 0, and setting the pixels of the remaining areas to 1, and performing element-by-element multiplication with the original input image, which is expressed as:
[0011]
[0012] Among them, Masklocal (R) represents an erasure mask, ⊙ represents element-by-element multiplication; the method for generating unknown samples based on local mosaics includes generating a local square area with a side length of R on the original image for the local mosaic mask, and H / R and W / R are random numbers between 1.1 and 1.2, uniformly generating a grid with a side length of G in the local square area, setting the value of each pixel in each grid to the average value of the pixel in the grid, generating a local mosaic mask, adding the generated local mosaic mask and the unknown sample based on local erasure to form an unknown sample based on the local mosaic mask, which is expressed as:
[0013]
[0014] Among them, Mosaic local(R,G) Represents a local mosaic mask superimposed on the original image.
[0015] As a preferred solution of the open set recognition method based on the untrained open set simulator described in the present invention, wherein: the extraction of discriminative features of known class images in the training set and the generated unknown class samples includes performing frequency domain transformation on the unknown samples, and using low-pass filtering based on discrete cosine transform to perform frequency domain transformation, which is expressed as:
[0016]
[0017]
[0018]
[0019] Among them, C(u,v) represents the array element of the DCT transform coefficient, u and v are the coordinates in the transform domain, f(x,y) represents the value of the two-dimensional image signal in the spatial domain, and x and y are the coordinates in the spatial domain.
[0020] As a preferred solution of the open set recognition method based on the untrained open set simulator described in the present invention, wherein: the discriminative features of the known class images extracted from the training set and the generated unknown class samples also include position transformation of the unknown samples, horizontal flipping flips the image pixels along the vertical central axis, and the objects in the image are mirror-symmetric in the horizontal direction, and vertical flipping flips the image pixels along the horizontal central axis to create a vertically symmetrical perspective.
[0021] As a preferred solution of the open set recognition method based on the untrained open set simulator of the present invention, wherein: the inputting of the discriminative features into the feature extractor and classifier based on prototype learning for training includes using unknown samples generated by the untrained open set simulator and known class data to jointly train the category prototype and network parameters, and converting the closed set training into the open set training by introducing unknown category samples during the training process, and the loss function is expressed as:
[0022] L first_step =L close +α·L open
[0023] Among them, L close and L open They represent closed set classification loss and open set classification loss respectively, α represents the proportion of open set classification loss in the loss function, and the distance between sample features and prototypes of different categories reflects the probability assigned to the sample belonging to the current category, and the assignment probability is calculated.
[0024] As a preferred solution of the open set recognition method based on the untrained open set simulator of the present invention, wherein: the calculation of the distribution probability includes the probability that the sample x belongs to the category k being expressed as:
[0025]
[0026] where f(·) represents the feature extractor network that extracts features from the input sample x, P represents the trainable category prototype, and P + represents the prototype corresponding to the category of the input sample x, K is the total number of known categories, and d(·) represents the dot product distance calculation formula;
[0027] L close It is set as the classification loss based on the negative log probability of the true category k, expressed as:
[0028] L close =-logS k
[0029] L open It is expressed as:
[0030]
[0031] in, Represents the probability that the unknown category feature belongs to category k.
[0032] As a preferred solution of the open set recognition method based on the untrained open set simulator described in the present invention, wherein: the inputting of the discriminative features into the feature extractor and classifier based on prototype learning for training also includes retaining the closed set classification ability of the model during the training process, and using known category samples to fine-tune the model parameters is expressed as:
[0033] L second_step =L close
[0034] After fine-tuning, prepare the dataset for training.
[0035] Another object of the present invention is to provide an open set recognition system based on an untrained open set simulator, which can degenerate specific key features of the original image by adopting local transformation to reduce its attribution to known categories, while retaining the remaining features to maintain their similarity with the known categories, thereby solving the problem that the current data closed set assumption method contains known categories in the training set.
[0036] As a preferred solution of the open set recognition system based on the untrained open set simulator described in the present invention, it includes: a local degradation module, a multi-transformation feature extraction module, and a feature extraction classification module; the local degradation module is used to collect original pictures, build an untrained open set simulator, perform local degradation operations on known class images, and simulate the generation of unknown samples; the multi-transformation feature extraction module is used to build a multi-transformation feature extraction model, extract the discriminative features of the known class images in the training set and the generated unknown class samples; the feature extraction classification module is used to input the discriminative features into the feature extractor and classifier based on prototype learning for training.
[0037] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of an open set recognition method based on a non-training open set simulator.
[0038] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of an open set recognition method based on an open set simulator without training.
[0039] Beneficial effects of the present invention: The open set recognition method based on the untrained open set simulator provided by the present invention removes the high-frequency information of the image through low-pass filtering, and uses the features of the low-frequency information representing the image content as part of the multi-transformation features, thereby enhancing the recognition accuracy, and constructing unknown samples for image flipping without large image differences, thereby improving the generalization ability of the model, making it more stable when facing variable and unknown data in the real world. Extracting discriminative features increases the diversity of data, allowing the model to recognize the same object from different perspectives and directions, improving the model's recognition accuracy for known categories, and also enhancing the ability to identify unknown categories. The present invention achieves better results in terms of stability, accuracy, and versatility. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0041] Figure 1 An overall flow chart of an open set recognition method based on an untrained open set simulator provided for the first embodiment of the present invention.
[0042] Figure 2 A network structure diagram of an open set recognition method based on an untrained open set simulator provided in the first embodiment of the present invention.
[0043] Figure 3 An overall flow chart of an open set recognition system based on an untrained open set simulator is provided for the third embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0045] Example 1
[0046] Reference Figure 1-Figure 2 , as an embodiment of the present invention, provides an open set recognition method based on an untrained open set simulator, comprising:
[0047] S1: Collect original images, build an untrained open set simulator, perform local degradation operations on known class images, and simulate the generation of unknown samples.
[0048] Furthermore, the core idea of the open set simulator is to use local transformation to degrade specific key features of the original image without introducing additional generative models to reduce its attribution to known categories, while retaining the remaining features to maintain its similarity to known categories. The additional open set samples obtained through the simulator are marked as unknown categories to participate in the training of the model, helping the classifier model the category boundary between known and unknown classes.
[0049] The simulation generation of unknown samples includes collecting the original image and then simulating the generation of unknown samples, including an unknown sample generation method based on local noise addition, an unknown sample generation method based on local erasure, and an unknown sample generation method based on local mosaic; the unknown sample generation method based on local noise addition includes taking the center point of the original input image as the center, selecting a square area with a side length of R on the image, where H / R and W / R take random numbers between 1.1 and 1.2, generating a noise value that obeys a Gaussian distribution with a mean of 0 and a variance of 1 in the square area, and setting the values of other areas outside the square area to 0, superimposing the local noise on the original input image, and the unknown sample generation based on local noise addition is expressed as:
[0050]
[0051] Among them, x i Represents the original input image, size H, W, Noise local(R) represents the local noise superimposed on the original image, K represents the total number of known categories, and K+1 represents that the label corresponding to the generated sample is an unknown category; the unknown sample generation method based on local erasure includes setting the side length of the local square area to be erased to R, H / R and W / R are random numbers between 1.5 and 2, setting the pixels of the square area to 0, and the pixels of the remaining areas to 1, and performing element-by-element multiplication with the original input image, which is expressed as:
[0052]
[0053] Among them, Mask local(R)Represents the erasure mask, ⊙ represents element-by-element multiplication. This design is based on the consideration that an overly large erasure area may lead to the loss of useful information, and the generated samples may be detrimental to the training of the model. The method for generating unknown samples based on local mosaics includes generating a local square area with a side length of R on the original image for the local mosaic mask, and H / R and W / R are random numbers between 1.1 and 1.2. In the local square area, a grid with a side length of G is uniformly generated, and the value of each pixel in each grid is set to the mean value of the pixel in the grid to generate a local mosaic mask. The generated local mosaic mask and the unknown sample based on local erasure are added to form an unknown sample based on the local mosaic mask, which is expressed as:
[0054]
[0055] Among them, Mosaic local(R,G) Represents a local mosaic mask superimposed on the original image.
[0056] S2: Build a multi-transform feature extraction model to extract discriminative features of known class images in the training set and generated unknown class samples.
[0057] Furthermore, for frequency domain transformation, from the perspective of human vision, low-pass filtering is used to process the image. Since the human eye can recognize the content difference between known class images and unknown class images, it can distinguish between known class images and unknown class images. Inspired by this phenomenon, this step removes the high-frequency information of the image through low-pass filtering, and uses the features of the low-frequency information representing the image content as part of the multi-transformation features. For position transformation, a flipping operation is used. For known class samples, the flipping operation does not change the semantic information of the image, but for unknown class images, there is a relatively large difference in the features extracted by the model before and after the image is flipped. .
[0058] It should be noted that extracting the discriminative features of the known class images in the training set and the generated unknown class samples includes performing frequency domain transformation on the unknown samples, and using low-pass filtering based on discrete cosine transform for frequency domain transformation, which is expressed as:
[0059]
[0060]
[0061]
[0062] Among them, C(u,v) represents the array element of the DCT transform coefficient, u and v are the coordinates in the transform domain, f(x,y) represents the value of the two-dimensional image signal in the spatial domain, and x and y are the coordinates in the spatial domain.
[0063] It should also be noted that the DCT transform processing method can introduce a small information loss while retaining all the information of the original signal. Since the DCT transform can effectively distinguish the high-frequency part and the low-frequency part in the data, the present invention designs a low-pass filtering method based on the DCT transform. After the image is transformed by the DCT, the high-frequency part is set to 0, and then the image is inversely transformed to the spatial domain by the DCT, thereby realizing the low-pass filtering of the image.
[0064] Furthermore, the discriminative features of the known class images in the training set and the generated unknown class samples are extracted, and the position transformation of the unknown samples is also included. The horizontal flip flips the image pixels along the vertical center axis, and the objects in the image are mirror-symmetric in the horizontal direction. The vertical flip flips the image pixels along the horizontal center axis to create a vertically symmetrical perspective.
[0065] It should be noted that the multi-transformation feature extraction module adopts the idea of ensemble learning. After performing multiple transformations on the input samples, the features of each transformed sample are extracted through a convolutional layer, and the extracted discriminative features are concatenated in the channel dimension, so that the input samples are jointly represented by these integrated multi-transformation features. Therefore, the model will mistakenly identify the unknown class samples as known class samples only when the known class samples and the unknown class samples are similar in multiple transformation dimensions.
[0066] S3: The discriminative features are input into the prototype learning based feature extractor and classifier for training.
[0067] Furthermore, the discriminative features are input into the feature extractor and classifier based on prototype learning for training, including using unknown samples generated by the untrained open set simulator and known class data to jointly train the category prototype and network parameters. By introducing unknown category samples during the training process, the closed set training is converted to open set training. The loss function is expressed as:
[0068] L ftrst_step =L close +α·L open
[0069] Among them, L close and L open They represent closed set classification loss and open set classification loss respectively, α represents the proportion of open set classification loss in the loss function, and the distance between sample features and prototypes of different categories reflects the probability that the sample belongs to the current category, and the probability of assignment is calculated. The smaller the distance between the sample feature and the prototype of a certain category, the greater the probability that the sample belongs to that category.
[0070] It should be noted that the calculation of the distribution probability includes the probability that the sample x belongs to the category k expressed as:
[0071]
[0072] Where f(·) represents the feature extractor network that extracts features from the input sample x, P represents the trainable category prototype, P+ represents the prototype corresponding to the category of the input sample x, K is the total number of known categories, and d(·) represents the dot product distance calculation formula;
[0073] L close It is set as the classification loss based on the negative log probability of the true category k, expressed as:
[0074] L close =-logS k
[0075] L open It is expressed as:
[0076]
[0077] in, Indicates the probability that the unknown category feature belongs to category k. The larger the dot product calculation value, the smaller the distance between the two features.
[0078] It should also be noted that inputting discriminative features into the prototype-based learning feature extractor and classifier for training also includes retaining the closed set classification ability of the model during the training process, and fine-tuning the model parameters using known category samples is expressed as:
[0079] Lsecond_step=Lclose
[0080] After fine-tuning, prepare the dataset for training.
[0081] Example 2
[0082] An embodiment of the present invention provides an open set recognition method based on an untrained open set simulator. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0083] First, referring to Table 1, the present invention selects six data sets of MNIST, SVHN, CIFAR10, CIFAR+10, CIFAR+50 and TinyImageNet for experiments respectively. Among them, the MNIST, SVHN and CIFAR10 data sets contain images of ten categories respectively. The present invention randomly selects six of them as known categories, and then regards the remaining four categories as unknown categories. For CIFAR+10 and CIFAR+50 data sets, the present invention randomly selects four of them as known categories from the CIFAR10 data set, and randomly selects 10 and 50 non-overlapping categories as unknown categories from the CIFAR100 data set. The TinyImageNet data set contains a total of 200 categories, and the present invention randomly samples 20 of them as known categories, and regards the remaining 180 categories as unknown categories. In order to evaluate the performance of the proposed algorithm, the present invention adopts AUROC (Area under the ROC curve) as an evaluation index. Among them, the ROC curve is an effective way to show the relationship between the true positive rate and the false positive rate. AUROC represents the area under the ROC curve, and its value range is between 0.1 and 1. It can be used as an intuitive indicator to evaluate the quality of a classifier. The larger the value, the better the performance of the classifier.
[0084] Table 1 Performance comparison of the invented algorithm and the existing open set recognition algorithm based on deep learning
[0085]
[0086] Example 3
[0087] Reference Figure 3 , which is an embodiment of the present invention, provides an open set recognition system based on an untrained open set simulator, including a local degradation module, a multi-transformation feature extraction module, and a feature extraction classification module.
[0088] Among them, the local degradation module is used to collect original pictures, build an untrained open set simulator, perform local degradation operations on known class images, and simulate the generation of unknown samples; the multi-transformation feature extraction module is used to build a multi-transformation feature extraction model to extract the discriminative features of known class images in the training set and the generated unknown class samples; the feature extraction classification module is used to input the discriminative features into the feature extractor and classifier based on prototype learning for training.
[0089] If the function is implemented in the form of 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, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0090] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0091] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0092] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc. It should be noted that the above embodiments are only used to illustrate the technical solution of the present invention and are not limited. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
[0093] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. An open set recognition method based on an untrained open set simulator, characterized in that: include: Collect original images, build an untrained open set simulator, perform local degradation operations on known class images, and simulate the generation of unknown samples; Construct a multi-transform feature extraction model to extract discriminative features of known class images in the training set and generated unknown class samples; The discriminative features are input into the feature extractor and classifier based on prototype learning for training; The simulation generation of unknown samples includes collecting the original picture and then simulating the generation of unknown samples, including an unknown sample generation method based on local noise addition, an unknown sample generation method based on local erasure, and an unknown sample generation method based on local mosaic; The unknown sample generation method based on local noise addition includes taking the center point of the original input image as the center, selecting a square area with a side length of R on the image, where H / R and W / R are random numbers between 1.1 and 1.2, generating a noise value that obeys a Gaussian distribution with a mean of 0 and a variance of 1 in the square area, and setting the values of other areas outside the square area to 0, superimposing the local noise on the original input image, and the unknown sample generation based on local noise addition is expressed as: Among them, x i Represents the original input image, size H, W, Noise local(R) represents the local noise superimposed on the original image, K represents the total number of known categories, and K+1 represents that the label corresponding to the generated sample is an unknown category; The unknown sample generation method based on local erasure includes setting the side length of the local square area to be erased as R, H / R and W / R as random numbers between 1.5 and 2, setting the pixels of the square area to 0, and setting the pixels of the remaining areas to 1, and performing element-by-element multiplication with the original input image, which is expressed as: Among them, Mask local(R) represents the erasure mask, ⊙ represents element-by-element multiplication; The method for generating unknown samples based on local mosaics includes generating a local square area with a side length of R on the original image for the local mosaic mask, and H / R and W / R are random numbers between 1.1 and 1.2, uniformly generating grids with a side length of G in the local square area, setting the value of each pixel in each grid to the average value of the pixel in the grid, generating a local mosaic mask, adding the generated local mosaic mask and the unknown sample based on local erasure to form an unknown sample based on the local mosaic mask, which is expressed as: Among them, Mosaic local(R,G) Represents a local mosaic mask superimposed on the original image; The extraction of discriminative features of known class images in the training set and the generated unknown class samples includes performing frequency domain transformation on the unknown samples, and performing frequency domain transformation using low-pass filtering based on discrete cosine transform, which is expressed as: Where, C(u,v) represents the array element of the DCT transform coefficient, u and v are the coordinates in the transform domain, f(x,y) represents the value of the two-dimensional image signal in the spatial domain, and x and y are the coordinates in the spatial domain; The extracting of discriminative features of known class images and generated unknown class samples in the training set also includes position transformation of unknown samples. Horizontal flipping flips image pixels along a vertical center axis so that objects in the image are mirror-symmetric in the horizontal direction. Vertical flipping flips image pixels along a horizontal center axis to create a vertically symmetrical perspective. The inputting of discriminative features into the feature extractor and classifier based on prototype learning for training includes using unknown samples generated by the untrained open set simulator and known class data to jointly train the category prototype and network parameters, and converting the closed set training into the open set training by introducing unknown category samples during the training process. The loss function is expressed as: L first_step =L close +α·L open Among them, L close and L open They represent closed set classification loss and open set classification loss respectively, α represents the proportion of open set classification loss in the loss function, and the distance between sample features and prototypes of different categories reflects the probability assigned to the sample belonging to the current category, and the assignment probability is calculated; The calculation of the distribution probability includes the probability that the sample x belongs to the category k being expressed as: where f(·) represents the feature extractor network that extracts features from the input sample x, P represents the trainable category prototype, and P + represents the prototype corresponding to the category of the input sample x, K is the total number of known categories, and d(·) represents the dot product distance calculation formula; L close It is set as the classification loss based on the negative log probability of the true category k, expressed as: L close =-logS k L open It is expressed as: in, Represents the probability that the unknown category feature belongs to category k; The inputting of discriminative features into the prototype learning-based feature extractor and classifier for training also includes retaining the closed set classification ability of the model during the training process, and fine-tuning the model parameters using known category samples as expressed as: L second_step =L close After fine-tuning, prepare the dataset for training.
2. A system using the open set recognition method based on an untrained open set simulator as claimed in claim 1, characterized in that: Including local degradation module, multi-transformation feature extraction module, feature extraction and classification module; The local degradation module is used to collect original images, construct a non-training open set simulator, perform local degradation operations on known class images, and simulate and generate unknown samples; The multi-transform feature extraction module is used to construct a multi-transform feature extraction model to extract discriminative features of known class images in the training set and generated unknown class samples; The feature extraction and classification module is used to input discriminative features into a feature extractor and classifier based on prototype learning for training.
3. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the open set recognition method based on a non-training open set simulator as described in claim 1 are implemented.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the open set recognition method based on a non-training open set simulator as described in claim 1 are implemented.
