Image identification method
By using current and historical sample features to train the target image recognition model, the problem of the neural network model's recognition ability decreases when adding new types of objects is solved, and the accuracy of image recognition is improved.
Patent Information
- Application Number
- PCT/SG2024/050206
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-04
- Filing Date
- 2024-03-29
- Publication Date
- 2024-11-07
AI Technical Summary
In existing image recognition technology, when neural network models continuously add new types of objects, the recognition ability of old types of objects will decline, resulting in inaccurate image recognition results.
By using the current sample features of the current sample image and the historical sample features of the historical sample image, the initial image recognition model is trained to generate a target image recognition model to avoid degradation of recognition capabilities.
This improves the accuracy of image recognition results and ensures that the model can still maintain high recognition capabilities of old-type objects when facing the increase of new-type objects.
Smart Images

Figure SG2024050206_07112024_PF_FP_ABST
Abstract
Description
[0001] Image Recognition Method Cross-Reference This disclosure claims priority to Chinese patent application No. 202310492315.1, filed with the China Patent Office on May 4, 2023, entitled "Image Recognition Method," the entire contents of which are incorporated herein by reference. Technical Field: Embodiments of the present disclosure relate to the field of computer technology, and more particularly, to an image recognition method. Background: With the continuous development and application of image recognition technology, image recognition technology can accurately identify objects of specific categories, thereby providing convenience for people's daily lives. Prior art image recognition technology is mostly implemented using neural network models. However, to adapt to the continuous addition of new object categories, neural network models also require continuous learning and training to recognize new types of objects. However, during the continuous learning and training process, as new types of objects continue to increase, the neural network model's ability to recognize old types of objects will gradually decline, resulting in reduced image recognition capabilities and inaccurate image recognition results. SUMMARY: In view of this, embodiments of the present disclosure provide an image recognition method. One or more embodiments of the present disclosure simultaneously relate to an image recognition model training method, another image recognition method, two image recognition apparatuses, an image recognition model training apparatus, a computing device, a computer-readable storage medium, and a computer program to address technical deficiencies in the prior art. According to a first aspect of an embodiment of the present disclosure, an image recognition method is provided, comprising: receiving an image to be recognized, inputting the image to be recognized into a target image recognition model, and obtaining an image recognition result for the image to be recognized. The target image recognition model is obtained by training an initial image recognition model based on current sample image features of a current sample image and historical sample image features of historical sample images; the initial image recognition model is obtained by training based on the historical sample image features. According to a second aspect of an embodiment of the present disclosure, a method for training an image recognition model is provided, comprising: determining a current sample image of an initial image recognition model, and performing feature extraction on the current sample image to obtain current sample image features; obtaining historical sample image features of the initial image recognition model, wherein the historical sample image features are image features generated during the process of training the initial image recognition model based on historical sample images; processing the historical sample image features and the current sample image features to obtain target sample image features; and training the initial image recognition model based on the target sample image features to obtain a target image recognition model.According to a third aspect of an embodiment of the present disclosure, an image recognition device is provided, comprising: an image recognition module configured to receive an image to be recognized, input the image to be recognized into a target image recognition model, and obtain an image recognition result of the image to be recognized, wherein the target image recognition model is obtained by training an initial image recognition model based on current sample image features of a current sample image and historical sample image features of historical sample images, and the initial image recognition model is obtained by training based on the historical sample image features. According to a fourth aspect of an embodiment of the present disclosure, an image recognition model training device is provided, comprising: a first feature acquisition module, configured to determine a current sample image of an initial image recognition model, and perform feature extraction on the current sample image to obtain current sample image features; a second feature acquisition module, configured to obtain historical sample image features of the initial image recognition model, wherein the historical sample image features are image features generated in the process of training the initial image recognition model based on historical sample images; a feature processing module, configured to process the historical sample image features and the current sample image features to obtain target sample image features; and a model training module, configured to train the initial image recognition model based on the target sample image features to obtain a target image recognition model. According to a fifth aspect of an embodiment of the present disclosure, an image recognition method is provided, which is applied to a cloud-side device and includes: obtaining an image to be recognized sent by an end-side device; inputting the image to be recognized into a target image recognition model to obtain an image recognition result of the image to be recognized, wherein the target image recognition model is obtained by training an initial image recognition model based on current sample image features of a current sample image and historical sample image features of a historical sample image, and the initial image recognition model is obtained by training based on the historical sample image features; and returning the image recognition result to the end-side device. According to a sixth aspect of an embodiment of the present disclosure, an image recognition apparatus is provided, which is applied to a cloud-side device and includes: an acquisition module, configured to acquire an image to be recognized sent by an end-side device; a recognition module, configured to input the image to be recognized into a target image recognition model to obtain an image recognition result of the image to be recognized, wherein the target image recognition model is obtained by training an initial image recognition model based on current sample image features of a current sample image and historical sample image features of historical sample images, and the initial image recognition model is obtained by training based on the historical sample image features; and a return module, configured to return the image recognition result to the end-side device.According to a seventh aspect of an embodiment of the present disclosure, a computing device is provided, comprising: a memory and a processor; the memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions, wherein the computer-executable instructions, when executed by the processor, implement the steps of the two image recognition methods and the image recognition model training method described above. According to an eighth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, the medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by the processor, implement the steps of the two image recognition methods and the image recognition model training method described above. According to a ninth aspect of an embodiment of the present disclosure, a computer program is provided, wherein, when executed on a computer, the computer program causes the computer to execute the steps of the two image recognition methods and the image recognition model training method described above. The image recognition method provided by the present disclosure includes: receiving an image to be recognized, inputting the image to be recognized into a target image recognition model, and obtaining an image recognition result for the image to be recognized, wherein the target image recognition model is obtained by training an initial image recognition model based on current sample image features of a current sample image and historical sample image features of historical sample images, and the initial image recognition model is obtained by training based on the historical sample image features. Specifically, the image recognition method provided by the present disclosure processes the image to be recognized using a target image recognition model obtained by training an initial image recognition model based on current sample image features of the current sample image and historical sample image features of historical sample images, after receiving the image to be recognized, thereby obtaining an accurate image recognition result. Furthermore, because the target image recognition model is obtained by training the initial image recognition model based on current sample image features of the current sample image and historical sample image features of historical sample images, and the initial image recognition model is obtained by training based on historical sample image features, the target image recognition model avoids the problem of the neural network model's ability to recognize old types of objects continuously decreasing as new types of objects continue to increase, as well as the problem of the model's image recognition ability decreasing, thereby improving the accuracy of image recognition results.BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a schematic diagram of an application scenario of an image recognition method provided by one embodiment of the present disclosure; Figure 2 is a flow chart of an image recognition method provided by one embodiment of the present disclosure; Figure 3 is a schematic diagram of model training in an image recognition method provided by one embodiment of the present disclosure; Figure 4 is a flow chart of an image recognition model training method provided by one embodiment of the present disclosure; Figure 5 is a schematic diagram of feature storage in an image recognition model training method provided by one embodiment of the present disclosure; Figure 6 is a schematic diagram of a fine-tuning module in an image recognition model training method provided by one embodiment of the present disclosure; Figure 7 is a schematic diagram of classification layer weight initialization in an image recognition model training method provided by one embodiment of the present disclosure; Figure 8 is a flow chart of a processing process of an image recognition model training method provided by one embodiment of the present disclosure; Figure 9 is a flow chart of another image recognition method provided by one embodiment of the present disclosure; and Figure 10 is a block diagram of a computing device provided by one embodiment of the present disclosure. DETAILED DESCRIPTION The following description sets forth numerous specific details to facilitate a thorough understanding of the present disclosure. However, the present disclosure can be implemented in many other ways than those described herein, and those skilled in the art may make similar generalizations without departing from the scope of the present disclosure. Therefore, the present disclosure is not limited to the specific implementations disclosed below. The terminology used in one or more embodiments of the present disclosure is for the purpose of describing specific embodiments and is not intended to limit the present disclosure. As used in one or more embodiments of the present disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present disclosure refers to and encompasses any and all possible combinations of one or more of the associated listed items. It should be understood that while the terms "first," "second," and so on may be used to describe various information in one or more embodiments of the present disclosure, such information should not be limited to these terms. These terms are used to distinguish between information of the same type. For example, the first could be referred to as the second, and similarly, the second could be referred to as the first, without departing from the scope of one or more embodiments of the present disclosure. Depending on the context, the term "if" as used herein could be interpreted as "when," "when," or "in response to determining." First, an explanation of the terminology used in one or more embodiments of the present disclosure is provided. Pretrained model: A model produced through large-scale training and fine-tuning on a representative dataset. It is usually set as the initialization model when training other downstream tasks to speed up training or achieve better results.Foundation Model: A type of pre-trained model. These models, trained using large amounts of data, powerful computing power, and carefully designed architectures, can be adapted to a range of downstream tasks across diverse domains.
[0002] Transformer: A network architecture that typically consists of several layers of encoders and decoders.
[0003] Vision Transformer: A network architecture that is a migration application of the Transformer architecture in the field of vision.
[0004] Transformer Block: A submodule of the Transformer, typically consisting of a multi-head attention and feedforward network. Multi-head Attention (MHA): A submodule within the Transformer, typically performing vector calculations on the query, key, and value. Lifelong Learning: An advanced machine learning paradigm that requires the model to learn new knowledge from successive learning tasks while not forgetting old knowledge. Class Incremental Learning: A special form of lifelong learning that assumes that different tasks contain different classes. Few-Shot Class Incremental Learning: Except for the first learning task, subsequent tasks contain very few training examples for each class. Catastrophic Forgetting: As the incremental learning process progresses, the model's performance on old classes degrades significantly. Overfitting: The model overfits to the training examples, resulting in poor classification performance on test examples. Image recognition: Assigning corresponding category labels to different image contents. Prototype features: Usually refers to the mean of all sample features of each class. Domain: Constituted by sample features and their marginal probability distribution. Old domain: The domain formed by samples of the old class. New domain: The domain formed by samples of the new class. Incremental domain: The domain formed by samples of the new and old classes. Incremental domain adaptation: Refers to migrating from the old domain to the incremental domain.
[0005] CLIP (Contrastive Language Image Pre-training): A pre-training model based on contrasting text-image pairs. With the continuous development and application of image recognition technology, it can accurately identify specific objects, thus providing convenience for people's daily lives. In recent years, supported by massive amounts of data and powerful computing power, deep models have achieved tremendous success in the field of image recognition. However, the performance of these models is limited to the categories included in the training set. In real-world image recognition scenarios, new categories often emerge continuously, posing a significant challenge to existing image recognition models. This challenge is often referred to as incremental learning, which requires the model to be able to recognize objects of new categories while preventing forgetting objects of old categories. However, due to privacy issues, device storage limitations, and high storage costs, data for objects of old categories is often unavailable, or only a small number of samples can be retained. This makes the model prone to catastrophic forgetting—a significant drop in performance for old categories. Existing incremental learning methods often assume sufficient data for new classes. However, in scenarios such as rare bird identification and auto part defect recognition, new bird or auto part defect samples are often scarce, making some existing incremental learning methods ineffective in these situations. Therefore, small-shot incremental learning has emerged. In small-shot incremental learning, training a model with a small number of samples from a new class can easily lead to overfitting of the training data, resulting in a severe catastrophic forgetting problem. To address this issue, existing small-shot incremental learning methods often freeze the model during the incremental phase. Furthermore, to adapt the model to new class objects, these methods tend to maximize the model's representational capabilities, supported by the sufficient training samples provided by the first learning task. However, small-shot incremental learning essentially defines an incremental domain adaptation problem: the domain constantly changes with the arrival of new tasks, requiring the model to dynamically adjust its output to adapt to the incremental domain as the learning task progresses. Furthermore, currently, basic pre-trained models, supported by massive amounts of data, provide powerful representational capabilities. Therefore, many researchers have developed transfer designs for downstream tasks based on existing basic pre-trained models, such as CLIP. In small-shot incremental learning, due to the small number of new class samples, it is difficult for the model to learn a good representation that enables it to effectively recognize new classes during the new task learning phase. Using basic pre-trained models can alleviate this problem to a certain extent. However, most existing work focuses on small-shot incremental learning of the original model.Based on this, the present disclosure provides an image recognition method. The present disclosure also relates to an image recognition model training method, another image recognition method, two image recognition devices, an image recognition model training device, a computing device, a computer-readable storage medium, and a computer program, each of which is described in detail in the following embodiments. Referring to FIG. 1 , FIG. 1 shows a schematic diagram of a specific scenario of an image recognition method provided according to one embodiment of the present disclosure. FIG. 1 illustrates a user 102, a front-end 104, and a back-end 106. User 102 can be understood as a user, operator, developer, etc. of a target project (e.g., a shopping website, a social networking website, etc.). Front-end 104 and back-end 106 can both be understood as servers, such as physical servers or cloud servers. The difference lies in the different processing tasks that front-end 104 and back-end 106 are responsible for. In actual applications, since front-end 104 faces the user, it is also referred to as the client below. In actual applications, front-end 104 and back-end 106 constitute an image recognition system, and the image recognition method is applied to the image recognition system. This method can be used in an end-to-end manner to fully connect the entire chain from user input of a recognition image to the final execution engine returning the recognition result, making image recognition, a high-frequency requirement, highly applicable in real-world project scenarios. For example, the large-scale image recognition capabilities provided by this image recognition method can be fully applied to image recognition and analysis in scenarios such as large social networks and shopping networks, greatly improving computational efficiency. The specific implementation process is as follows: In one embodiment provided by the present disclosure, user 102 can capture an image of a bird using a camera or other means and send the captured bird image to front-end 104. Front-end 104 forwards the received bird image to back-end 106 for processing. Back-end 106 then inputs the bird image into a target image recognition model, uses the target image recognition model to identify the bird image, and obtains an image recognition result indicating whether the bird is a protected species.The backend 106 then sends the image recognition results to the frontend 104, which then provides the image recognition results (e.g., non-protected birds) to the user 102. Based on this, the image recognition method provided by the present disclosure can identify bird images using a target image recognition model, thereby obtaining accurate image recognition results. Furthermore, because the target image recognition model is trained using the current sample image features of the current sample image and the historical sample image features of the historical sample images, and the initial image recognition model is trained based on the historical sample image features, the target image recognition model avoids the problem of the neural network model's ability to recognize old types of objects declining as new types of objects continue to increase, as well as the problem of the model's image recognition ability decreasing, thereby improving the accuracy of image recognition results. Figure 2 shows a flowchart of an image recognition method provided according to one embodiment of the present disclosure, specifically including the following steps: Step 202: Receive an image to be recognized and input the image to be recognized into the target image recognition model to obtain an image recognition result for the image to be recognized. The target image recognition model is obtained by training an initial image recognition model based on the current sample image features of the current sample image and the historical sample image features of the historical sample images. The initial image recognition model is obtained by training based on the historical sample image features. The image to be recognized refers to an image requiring image recognition, such as an image of a bird or an image of an automobile part. The image recognition method provided in this disclosure can accurately identify protected birds in e-commerce scenarios through image recognition technology to prevent the trafficking of protected animals; or accurately identify faulty automobile parts through image recognition technology. The target image recognition model can be understood as a neural network model capable of image recognition. The image recognition result can be understood as the recognition result for the image to be recognized, which can be a classification label, such as a label indicating whether it is a protected bird or a label indicating whether it is a defective automobile part. The current sample image can be understood as an image used as a sample to train the target image recognition model, such as an image of a protected bird or an image of a defective automobile part. It should be noted that this solution can be applied to the field of lifelong learning, providing a small-sample incremental learning method based on a pre-trained basic model. Therefore, the target image recognition model is trained based on the initial image recognition model. The historical sample images can be understood as the models used to train the initial image recognition model before the current sample images. For example, images of protected birds or defective automobile parts, which are different from the current sample images, may be used.The initial image recognition model can be understood as a neural network model capable of image recognition. Due to the continuous increase in new object categories, a lifelong learning approach is required to train the initial image recognition model to adapt to the growing number of new object types. For example, these new object categories include birds newly listed as protected species and newly discovered defective automobile parts. Specifically, the image recognition method provided by the present disclosure can input a received image to be recognized into a trained target image recognition model, and then use the target image recognition model to perform image recognition on the image to be recognized, thereby obtaining an image recognition result. The image to be recognized can be provided by an image provider, which can be a user or other computing device. Such computing devices include, but are not limited to, clients, servers, and smart terminals. Furthermore, in the embodiments provided by the present disclosure, the target image recognition model first extracts features during recognition of the image to be recognized and then classifies the extracted image features to accurately obtain an image recognition result for the image to be recognized. Specifically, inputting the image to be recognized into a target image recognition model to obtain an image recognition result for the image to be recognized includes: inputting the image to be recognized into the target image recognition model, extracting features of the image to be recognized using a feature extraction module in the target image recognition model to obtain image features of the image to be recognized; and performing image recognition on the image features using an image recognition module in the target image recognition model to obtain an image recognition result for the image to be recognized. The feature extraction module can be understood as a network layer or encoding layer in the target image recognition model configured to perform feature extraction. By inputting the image to be recognized into the feature extraction module, image features of the image to be recognized can be obtained. It should be noted that the feature extraction module may include multiple network layers or multiple encoding layers. The image recognition module can be understood as a network layer or encoding layer in the target image recognition model configured to perform image recognition. In practical applications, the image recognition module can be a classification layer configured to classify the image to be recognized. By inputting image features into the classification layer, classification results for the image features can be obtained. For example, by inputting the image features of a bird image into the classification layer, a classification result can be obtained, indicating whether the image is of a protected bird species. Specifically, the image recognition method provided by the present disclosure can input a received image to be recognized into a trained target image recognition model. The feature extraction module within the target image recognition model then extracts features from the image to be recognized, obtaining image features of the image to be recognized. These image features are then input into the image recognition module within the target image recognition model, thereby quickly and accurately obtaining an image recognition result for the image to be recognized.In one embodiment provided by the present disclosure, to address the challenges encountered during the application of the aforementioned image recognition model, this method leverages a basic pre-trained model and designs an incremental domain adaptation method to help the model continuously learn new knowledge. This method extracts and stores early-stage features from both new and old task training data, and uses these features to supplement mid-stage features to achieve lightweight fine-tuning of the model output, thereby enabling the model to adapt to domains that dynamically change with the learning task. Compared to previous methods, this solution achieves relatively good small-sample incremental image recognition performance while minimizing memory usage. Specifically, before receiving an image to be recognized and inputting it into a target image recognition model to obtain an image recognition result for the image to be recognized, the method further includes: determining a current sample image for the initial image recognition model and performing feature extraction on the current sample image to obtain current sample image features; obtaining historical sample image features of the initial image recognition model, wherein the historical sample image features are image features generated during the training of the initial image recognition model based on historical sample images; processing the historical sample image features and the current sample image features to obtain target sample image features; and training the initial image recognition model based on the target sample image features to obtain a target image recognition model. The initial image recognition module can be understood as the pre-trained model or base model described above. Specifically, in the image recognition method provided herein, before performing image recognition, the initial image recognition model needs to be trained based on the current sample image features of the current sample image and the historical sample image features of historical sample images to obtain a target image recognition model. The training process first involves determining a current sample image for the initial image recognition model. The current sample image can be understood as an image of the aforementioned new type of object. After determining the current sample image, the current sample image is input into the initial image recognition model. The feature extraction module within the initial image recognition model then extracts features from the current sample image to obtain current sample image features. Historical sample image features of the initial image recognition model are then retrieved from the database. It should be noted that the image recognition method provided herein, during model training, stores the sample image features extracted from the sample image in the database. This facilitates subsequent model training based on the sample image features, avoiding the problem of a neural network model's ability to recognize old types of objects declining as new types of objects continue to increase, as well as a reduction in the model's image recognition capabilities.Therefore, when using historical sample images to train the initial image recognition model, the historical sample image features of the historical sample images are stored in a database. After obtaining the historical sample image features, the feature processing module in the initial image recognition model fuses the historical sample image features with the current sample image features to obtain target sample image features. Finally, the initial image recognition model is trained using the target sample image features to obtain a target image recognition model. It should be noted that the application scenarios of the image recognition method provided by the present disclosure include many scenarios where new types of data are scarce and incremental recognition is required. Taking the application of the image recognition method provided by the present disclosure in the scenario of defective automobile parts identification as an example, the model training process in the image recognition method provided by the present disclosure can be seen in Figure 3. The initial sample recognition model is a pre-trained basic model, and the training data is images of defective automobile parts. The tasks in Figure 3 can be understood as learning tasks for various new types of objects. For example, the task of identifying defective automobile parts. On an automobile production line, defective parts have a significant impact on automobile quality. However, in actual industrial production, defective part samples are extremely rare, and over time, new types of defective parts may appear due to reasons such as machine failure and aging. The model needs to be able to incrementally identify these to ensure automobile production quality. Therefore, the model first extracts the training data for the current task through the early-stage network layer to obtain early-stage features of the current task training data, and stores these early-stage features. Then, the model extracts the early-stage features through the mid-stage network layer to obtain mid-stage features. The historical early-stage features stored in the database are then used to fine-tune the current mid-stage features to obtain training features. Finally, the training features output from the training data are used to initialize the weights of the model's classification layer, and the initialized weights are used to classify the output features of the test data. This completes the training of the pre-trained basic model.The image recognition method provided by the present disclosure processes the image to be recognized using a target image recognition model trained using the current sample image features of the current sample image and the historical sample image features of historical sample images, thereby obtaining accurate image recognition results. Furthermore, because the target image recognition model is trained using the current sample image features of the current sample image and the historical sample image features of historical sample images, and the initial image recognition model is trained based on the historical sample image features, this target image recognition model avoids the problem of a neural network model's ability to recognize old objects declining as new types of objects are added, as well as the problem of the model's image recognition ability decreasing, thereby improving the accuracy of image recognition results. Figure 4 shows a flowchart of an image recognition model training method provided according to one embodiment of the present disclosure, specifically including the following steps: Step 402: Determine a current sample image for the initial image recognition model and perform feature extraction on the current sample image to obtain current sample image features. In one embodiment provided by the present disclosure, extracting features from the current sample image to obtain current sample image features includes: inputting the current sample image into the initial image recognition model, and utilizing a feature extraction module within the initial image recognition model to extract features from the current sample image to obtain current sample image features of the current sample image. Specifically, the image recognition method provided by the present disclosure can input the current sample image into the initial image recognition model, and utilize the feature extraction module within the initial image recognition model to extract features from the current sample image to obtain current sample image features of the current sample image. In the embodiment provided by the present disclosure, the feature extraction module includes at least two feature extraction modules. Based on this, the step of inputting the current sample image into the initial image recognition model, performing feature extraction on the current sample image using a feature extraction module in the initial image recognition model, and obtaining current sample image features of the current sample image includes: inputting the current sample image into the initial image recognition model, performing feature extraction on the current sample image using a first feature extraction module in the initial image recognition model, and obtaining first sample image features; and performing feature extraction on the first sample image features using a second feature extraction module in the initial image recognition model, and obtaining current sample image features of the current sample image.In one embodiment of the present disclosure, after inputting the current sample image into the initial image recognition model and extracting features from the current sample image using the first feature extraction module in the initial image recognition model to obtain the first sample image features, the method further includes calculating the mean features of the first sample image features and storing the mean features. Continuing with the above example, FIG5 is a schematic diagram of feature storage in an image recognition model training method provided in one embodiment of the present disclosure. As shown in FIG5 , the image processing model training method provided in the present disclosure inputs training data into the early-stage network coding layer (first feature extraction module), obtains early-stage features of each category of training data, then calculates the mean of the early-stage features of each category of training data, and finally stores the mean early-stage features in a feature library. The feature library can be understood as a database for storing features for easy use during the next model training. Then, the training data and test data for each task are sequentially input into the early-stage and mid-stage network layers, and the obtained mid-stage features are stored. Step 404: Obtain historical sample image features of the initial image recognition model. The historical sample image features are image features generated during the training of the initial image recognition model based on historical sample images. Specifically, the image recognition model training method provided by the present disclosure obtains the historical sample image features generated during the training of the initial image recognition model from a database. Continuing with the above example, the mean features stored in the database during the training of the historical image recognition model are obtained from the database. Step 406: Process the historical sample image features and the current sample image features to obtain target sample image features. Specifically, in one embodiment provided by the present disclosure, to enable the image recognition model to handle successive incremental tasks without degrading model performance, a fine-tuning module injects saved early-stage features into the encoder's stage features, thereby achieving lightweight fine-tuning of the model output. Specifically, processing the historical sample image features and the current sample image features to obtain the target sample image features includes: utilizing the feature processing module in the initial image recognition model to perform feature correlation on the historical sample image features and the current sample image features to obtain the target sample image features. The feature processing module can be understood as a module that can adjust the features of the current sample image using the features of the historical sample images. The feature processing module can refer to the fine-tuning module described above, which can inject the saved early-stage features into the mid-stage features. The feature processing module can be a Transformer block.Therefore, this method uses a single-headed Transformer block as the fine-tuning module. Specifically, the mid-stage feature Q is used, and the stored early-stage features K and V are used. Figure 6 is a schematic diagram of the fine-tuning module in an image recognition model training method provided by one embodiment of the present disclosure. As shown in Figure 6, the mid-stage feature Q is input into the Transformer block, which then fine-tunes the mid-stage feature Q using the early-stage features K and V obtained from the database M, thereby obtaining fine-tuned features. Furthermore, in one embodiment provided by the present disclosure, utilizing the feature processing module in the initial image recognition model to perform feature association on the historical sample image features and the current sample image features to obtain target sample image features includes: utilizing the feature processing module in the initial image recognition model, using the current sample image features as query conditions, and calculating a similarity coefficient between the historical sample image features and the query conditions; weighting the current sample image features using the similarity coefficient to obtain weighted features; and adding the weighted features to the current sample image features to obtain target sample image features. The similarity coefficient is a coefficient representing the similarity between the current sample image features used as query conditions and the historical sample image features. Continuing with the above example, in the image recognition model training method provided by this disclosure, after obtaining mid-stage features, the fine-tuning module uses the mid-stage features of the training data as a query statement, calculates the similarity coefficient between the query statement and the mean of the stored early-stage features, then uses the similarity coefficient to weight the stored early-stage features. Finally, the weighted result is added to the query statement to obtain the training features. Step 408: Train the initial image recognition model based on the target sample image features to obtain a target image recognition model. In one embodiment provided in the present disclosure, to address the problem that, during the process of training a neural network model using a lifelong learning approach, the model's recognition ability for old types of objects continuously declines, resulting in a reduction in the model's image recognition ability, the present method utilizes adjusted features for model training and testing, thereby ensuring that the problem of reduced image recognition ability of the model is avoided. Specifically, the training of the initial image recognition model based on the target sample image features to obtain the target image recognition model includes steps 1 and 2: Step 1: Generate updated weights based on the target sample image features, and use the updated weights to update the original weights of the initial image recognition model to obtain an image recognition model to be tested.Specifically, generating updated weights based on the target sample image features and using the updated weights to update the original weights of the initial image recognition model to obtain the image recognition model to be tested includes: inputting the target sample image features into the third feature extraction module of the initial image recognition model to obtain model training features; calculating the feature mean of the model training features and using the feature mean as the updated weights; and determining the original weights of the image recognition module in the initial image recognition model and replacing the original weights with the updated weights to obtain the image recognition model to be tested. The third feature extraction module can be understood as a network layer or encoding layer configured to extract features. Continuing with the above example, FIG7 is a schematic diagram of initializing classification layer weights in an image recognition model training method provided by one embodiment of the present disclosure. FIG7 shows that after obtaining training features and test features, they are input into the subsequent network encoding layer to obtain subsequent features. By obtaining the subsequent feature mean of each category of training data to initialize the classification layer weights, parameter adjustment of the image recognition model is completed, thereby enabling the model to handle each subsequent incremental task. And ensure the stability of the model's performance. For example, if the original classification layer weight dimension is D, and the new task contains 5 categories, then first randomly initialize 5 feature vectors, then obtain the later stage feature means of the training data corresponding to the 5 categories, and then use these means to initialize the features, and connect the initialized features with the previous classification layer weights, so as to replace the 5 feature vectors with the later stage feature means, and the new classification layer weight dimension is N*D. Among them, N represents the number of categories of the new task; D represents the dimension of the weight. Step 2: Based on the current test image corresponding to the current sample image, perform a model test on the image recognition model to be tested, and when it is determined that the model test passes, determine the image recognition model to be tested as the target image recognition model. Specifically, based on the current test image corresponding to the current sample image, perform a model test on the image recognition model to be tested, and when it is determined that the model test passes, determine the image recognition model to be tested as the target image recognition model, including: inputting the current test image corresponding to the current sample image into the image recognition model to be tested, and obtaining the test image recognition result of the current test image; If the test image recognition result satisfies the preset test pass criteria, the image recognition model to be tested is determined as the target image recognition model. Continuing with the above example, after the model's classification layer weights are initialized, test data corresponding to the training sample is determined. The test sample data is then input into the weight-initialized image recognition model to obtain a classification result for the test sample data.The loss function of the image recognition model is calculated based on the sample labels of the test sample data and the classification results. If the loss function reaches convergence, the model is determined to have passed the test, thereby obtaining a trained target image recognition model, which facilitates subsequent accurate recognition of the target image based on the target image recognition model. It should be noted that the image recognition model training method provided herein is an incremental domain adaptation method designed to address incremental learning for small sample classes. Using a basic pre-trained model, early-stage features of the training data are extracted and stored. A fine-tuning module injects these stored early-stage features into the encoder to achieve lightweight fine-tuning of the model output, enabling the model to handle subsequent incremental tasks. To ensure smooth model training, the fine-tuning module must be trained in advance. Specifically, before obtaining the target sample image features by using the feature processing module in the initial image recognition model to perform feature association between the historical sample image features and the current sample image features, the method further includes: determining training samples corresponding to the feature processing module and training the feature processing module using the training samples to obtain a trained feature processing module. Specifically, the image recognition model training method provided herein proposes a pseudo-incremental knowledge injection training strategy for the fine-tuning module. Since the incremental phase has limited data and old data is unavailable, training the fine-tuning module during the incremental phase is difficult. Therefore, a corresponding pseudo-incremental knowledge injection strategy is designed to learn the fine-tuning module parameters. This pseudo-incremental knowledge injection strategy relies on old class sample data to train the model by simulating the actual incremental process. Based on this, determining training samples corresponding to the feature processing module and training the feature processing module using the training samples to obtain a trained feature processing module includes: determining training samples corresponding to the feature processing module and dividing the training samples into first and second training samples; training the feature processing module based on the first training samples to obtain a first loss function; training the feature processing module based on the first and second training sample data to obtain a second loss function; and training the feature processing module based on the first and second loss functions to obtain a trained feature processing module. Continuing with the above example, this method divides the old class sample data into two parts: a pseudo base set and a pseudo incremental set. Each category in the pseudo-incremental set contains a small amount of training data, such as one training example. The early network coding layer features of the training data in the pseudo-base set are then extracted and used as pseudo-old class knowledge. Simultaneously, the early network coding layer features of the training data in the pseudo-incremental set are also extracted and used as pseudo-new class knowledge.After determining the pseudo-old and pseudo-new knowledge, the pseudo-new knowledge is used to inject knowledge into the pseudo-incremental set data, adjusting the model's output for the pseudo-incremental set data. Finally, the prototype features of the pseudo-incremental set training data are calculated and used as classification weights to classify the adjusted model output for the test data. Cross-entropy loss 1 (i.e., the first loss function) is then used to calculate the first loss function. After determining the first loss function, the pseudo-new and pseudo-old knowledge are combined to form the pseudo-full knowledge. The pseudo-incremental set and the pseudo-base set are combined to form the pseudo-full set. The pseudo-full knowledge is then injected into the pseudo-full set data to adjust the model's output for the pseudo-full set data. Finally, the prototype features of the pseudo-full set training data are calculated and used as classification weights to classify the adjusted model output for the pseudo-full set test data. Cross-entropy loss 2 (i.e., the second loss function) is then used to calculate the model. The model is optimized using the cross-entropy loss 1 and cross-entropy loss 2 until the training stop condition is met, resulting in a well-trained fine-tuning module. The image recognition model training method provided in this disclosure trains an initial image recognition model based on the current sample image features of the current sample image and the historical sample image features of the historical sample images, thereby obtaining a target image recognition model with high stability and accuracy. This avoids the problem of a neural network model's ability to recognize old object types declining as new object types continue to increase, as well as the problem of the model's image recognition ability decreasing, thereby improving the accuracy of image recognition results. The above is a schematic diagram of an image recognition model training method according to this embodiment. It should be noted that the technical solution of this image recognition model training method and the technical solution of the aforementioned image recognition method are based on the same concept. Details not described in detail in the technical solution of the image recognition model training method can be found in the corresponding or corresponding sections of the description of the technical solution of the aforementioned image recognition method, and this disclosure will not elaborate on them in detail here. Similarly, details not described in detail in the technical solution of the image recognition method can be found in the corresponding or corresponding sections of the description of the technical solution of the aforementioned image recognition model training method. The following, in conjunction with FIG8 , further illustrates the image recognition model training method provided in this disclosure using the application of the image recognition model training method in a small-sample incremental learning scenario based on a pre-trained basic model as an example. FIG8 illustrates a flowchart of a processing procedure for an image recognition model training method according to an embodiment of the present disclosure, specifically including the following steps: Step 802: During model training, the training data and test data for each task are first input into the early-stage network layer of the image recognition model for feature extraction, thereby obtaining early-stage features of the training and test data.It should be noted that before model training, various categories of training data must be input into the early-stage network coding layer of the image recognition model to obtain early-stage features for each category of training data. The mean of the early-stage features for each category of training data is then calculated and stored in the feature library. Step 804: The early-stage features of the training and test data are input into the mid-stage network layer of the image recognition model for feature extraction, obtaining mid-stage features for the training and test data. Step 806: The mid-stage features of the training and test data are input into the fine-tuning module for feature fine-tuning. The fine-tuning process for the mid-stage features of the training data is as follows: The fine-tuning module uses the mid-stage features of the training data as query statements, calculates the similarity coefficient between the query statement and the stored early-stage feature mean, then uses the similarity coefficient to weight the stored early-stage features. Finally, the weighted result is added to the query statement to obtain the training features. The fine-tuning process for the mid-stage features of the test data is as follows: The fine-tuning module uses the mid-stage features of the test data as query statements, calculates the similarity coefficient between the query statement and the stored early-stage feature mean, then uses the similarity coefficient to weight the stored early-stage features. Finally, the weighted result is added to the query statement to obtain the test features. Step 808: The obtained training and test features are input into the late-stage network coding layer of the image recognition network to obtain the late-stage features of the training and test data. Step 810: The late-stage features of the training data for each task are determined and the mean of the late-stage features is calculated. The classification layer weights are replaced with the mean, thereby initializing the classification layer weights with the mean. After the classification layer weights are initialized, the late-stage features of the test data are input into the classification layer for classification, obtaining the classification results of the test data. Based on the classification results and the labels of the test data, the loss function of the image recognition model is calculated, and the model is trained based on this loss function until the training stop condition is met. It should be noted that, since the fine-tuning module is required to adjust features during image recognition model training, it must be trained with samples before model training to ensure smooth subsequent image recognition model training. This fine-tuning module is a Transformer block, and the training process for this module is as follows. Step 1: Divide the old class training data into two parts: a pseudo-base set and a pseudo-increment set. The pseudo-increment set contains a small amount of training data for each class, such as one sample; the pseudo-base set contains a larger amount of training data for each class.Step 2: Using the early network coding layer in the image recognition model, extract early network coding layer features from the pseudo-base set training data and use them as pseudo-old class knowledge. Simultaneously, extract early network coding layer features from the pseudo-incremental set training data and use them as pseudo-new class knowledge. Step 3: Infuse the pseudo-incremental set data with pseudo-new class knowledge to adjust the output of the fine-tuning module for the pseudo-incremental set data. Step 4: Using the early and mid-stage network layers of the image recognition model, extract prototype features from the pseudo-incremental set training data. Using these prototype features as classification weights, classify the fine-tuning module output after adjustment on the test data, and then calculate the loss 1 using cross entropy. Step 5: Combine the pseudo-new class knowledge and pseudo-old class knowledge to form pseudo-full knowledge. Step 6: Combine the pseudo-incremental set and the pseudo-base set to form the pseudo-full set. Step 7: Inject pseudo-full dataset data with pseudo-full dataset knowledge to adjust the fine-tuning module's output for the pseudo-full dataset. Step 8: Extract prototype features from the pseudo-full dataset training data through the early and mid-stage network layers of the image recognition model. Use these prototype features as classification weights to classify the adjusted model output on the pseudo-full dataset test data, and then calculate loss 2 using cross-binning. Step 9: Optimize the model using loss 1 obtained in step 4 and loss 2 obtained in step 8 to obtain the trained fine-tuning module (Transformer block). Based on the above, this method designs an incremental domain adaptation method designed to address incremental learning of small-sample classes. Leveraging a basic pre-trained model, early-stage features of the training data are extracted and stored. The fine-tuning module then injects these stored early-stage features into the encoder, achieving lightweight fine-tuning of the model output, enabling the model to handle subsequent incremental tasks. To learn the training parameters of the fine-tuning module, a corresponding pseudo-incremental knowledge injection training strategy was designed. By sampling old data, a pseudo-base set and pseudo-incremental set are constructed to simulate the actual incremental process to achieve model optimization. Figure 9 shows a flowchart of another image recognition method provided according to an embodiment of the present disclosure. This alternative image recognition method is applied to a cloud-side device and specifically includes the following steps: Step 902: Obtain an image to be recognized sent by a client-side device; Step 904: Input the image to be recognized into a target image recognition model to obtain an image recognition result for the image to be recognized. The target image recognition model is obtained by training an initial image recognition model based on the current sample image features of the current sample image and the historical sample image features of historical sample images. The initial image recognition model is trained based on the historical sample image features; Step 906: Return the image recognition result to the client-side device.The cloud-side device can be understood as a device located in the cloud and capable of providing cloud services to end-user devices. For example, the cloud-side device can be one or more servers or one or more hosts. In one embodiment provided in the present disclosure, the cloud-side device can also be composed of a cloud-side computing device and / or a cloud-side storage device. The cloud-side computing device can be understood as a device located in the cloud and capable of providing computing services to end-user devices. For example, the cloud-side computing device can be one or more servers. The cloud-side storage device can be understood as a device located in the cloud and capable of providing storage services to end-user devices. Examples include one or more database storage servers, cloud disks, etc. The end-user device can be understood as a device located opposite the cloud-side device and capable of using the cloud services provided by the cloud-side device. Such end-user devices include, but are not limited to, clients, terminals, computers, servers, mobile phones, or smart mobile devices. Specifically, another image recognition method provided in the present disclosure can be applied to a cloud-side device. An image to be recognized sent by the end-user device can be obtained, and image recognition processing can be performed on the image to be recognized using a trained target image recognition model to obtain an image recognition result for the image to be recognized. The image recognition result for the image to be recognized can then be transmitted to the end-user device. For example, the alternative image recognition method will be described using a smartphone as the end-side device and a cloud-side server as the cloud-side device. Specifically, in actual applications, a user can use a smartphone to send a captured bird image to the cloud server. After receiving the bird image, the cloud server inputs the bird image into a target image recognition model and uses the target image recognition model to identify the bird image and obtain an image recognition result indicating whether the bird is a protected species. After determining the image recognition result for the bird image, the cloud server can return the image recognition result to the smartphone, which then displays the image recognition result to the user. Based on this, the present disclosure provides another image recognition method for a cloud device. After receiving an image to be recognized from the end-side device, the method processes the image to be recognized using a target image recognition model trained using an initial image recognition model based on current sample image features and historical sample image features of historical sample images, thereby obtaining an accurate image recognition result. This accurate image recognition result is then returned to the end-side device, conserving computing resources on the end-side device.Furthermore, because the target image recognition model is obtained by training an initial image recognition model based on the current sample image features of the current sample image and the historical sample image features of the historical sample images, and the initial image recognition model is trained based on the historical sample image features, the target image recognition model avoids the problem of the neural network model's ability to recognize old types of objects decreasing as new types of objects continue to increase, as well as the problem of the model's image recognition ability decreasing, thereby improving the accuracy of image recognition results. Corresponding to the above-mentioned method embodiments, the present disclosure also provides an image recognition device embodiment, which includes: an image recognition module configured to receive an image to be recognized, input the image to be recognized into the target image recognition model, and obtain an image recognition result for the image to be recognized. The target image recognition model is obtained by training an initial image recognition model based on the current sample image features of the current sample image and the historical sample image features of the historical sample images, and the initial image recognition model is trained based on the historical sample image features. Optionally, the image recognition module is further configured to: input the image to be recognized into a target image recognition model; perform feature extraction on the image to be recognized using a feature extraction module in the target image recognition model to obtain image features of the image to be recognized; and perform image recognition on the image features using the image recognition module in the target image recognition model to obtain an image recognition result for the image to be recognized. Optionally, the image recognition device further includes a model training module configured to: determine a current sample image for the initial image recognition model and perform feature extraction on the current sample image to obtain current sample image features; obtain historical sample image features of the initial image recognition model, wherein the historical sample image features are image features generated during the training of the initial image recognition model based on historical sample images; process the historical sample image features and the current sample image features to obtain target sample image features; and train the initial image recognition model based on the target sample image features to obtain a target image recognition model.The image recognition device provided in the present disclosure, upon receiving an image to be recognized, processes the image to be recognized using a target image recognition model trained using the current sample image features of the current sample image and the historical sample image features of the historical sample images, thereby obtaining accurate image recognition results. Furthermore, because the target image recognition model is trained using the current sample image features of the current sample image and the historical sample image features of the historical sample images, while the initial image recognition model is trained using the historical sample image features, this target image recognition model avoids the problem of a neural network model's ability to recognize old types of objects declining as new types of objects are added, as well as the problem of the model's image recognition capabilities decreasing, thereby improving the accuracy of image recognition results. The above is a schematic diagram of an image recognition device according to this embodiment. It should be noted that the technical solutions of this image recognition device and the technical solutions of the aforementioned image recognition method share the same concept. Details not described in detail in the technical solution of the image recognition device can be found in the description of the technical solution of the aforementioned image recognition method. Corresponding to the above-mentioned method embodiments, the present disclosure also provides an embodiment of an image recognition model training device, comprising: a first feature acquisition module configured to determine a current sample image of an initial image recognition model and perform feature extraction on the current sample image to obtain current sample image features; a second feature acquisition module configured to acquire historical sample image features of the initial image recognition model, wherein the historical sample image features are image features generated during the training of the initial image recognition model based on historical sample images; a feature processing module configured to process the historical sample image features and the current sample image features to obtain target sample image features; and a model training module configured to train the initial image recognition model based on the target sample image features to obtain a target image recognition model. Optionally, the first feature acquisition module is further configured to: input the current sample image into the initial image recognition model, and perform feature extraction on the current sample image using the feature extraction module in the initial image recognition model to obtain current sample image features of the current sample image. Optionally, the feature processing module is further configured to: utilize the feature processing module in the initial image recognition model to perform feature association on the historical sample image features and the current sample image features to obtain target sample image features.Optionally, the feature processing module is further configured to: utilize the feature processing module in the initial image recognition model, use the current sample image feature as a query condition, and calculate a similarity coefficient between the historical sample image feature and the query condition; weight the current sample image feature using the similarity coefficient to obtain a weighted feature, and add the weighted feature to the current sample image feature to obtain a target sample image feature. Optionally, the model scraping module is further configured to: generate updated weights based on the target sample image feature, and use the updated weights to update the original weights of the initial image recognition model to obtain a to-be-tested image recognition model; perform a model test on the to-be-tested image recognition model based on a current test image corresponding to the current sample image, and if the model test is determined to have passed, determine the to-be-tested image recognition model as the target image recognition model. Optionally, the model training module is further configured to: input the target sample image features into the third feature extraction module of the initial image recognition model to obtain model training features; calculate the feature mean of the model training features and use the feature mean as the updated weights; determine the original weights of the image recognition module in the initial image recognition model and replace the original weights with the updated weights to obtain the image recognition model to be tested. Optionally, the model training module is further configured to: input the current test image corresponding to the current sample image into the image recognition model to be tested to obtain a test image recognition result for the current test image; and if it is determined that the test image recognition result meets a preset test pass condition, determine the image recognition model to be tested as the target image recognition model. Optionally, the image recognition model training device further includes a feature processing module training module configured to: determine training samples corresponding to the feature processing module and train the feature processing module using the training samples to obtain a trained feature processing module. Optionally, the feature processing module training module is configured to: determine a training sample corresponding to the feature processing module, and divide the training sample into a first training sample and a second training sample; train the feature processing module based on the first training sample to obtain a first loss function; train the feature processing module based on the first training sample and the second training sample data to obtain a second loss function; and train the feature processing module based on the first loss function and the second loss function to obtain a trained feature processing module.The image recognition model training device provided in this disclosure trains an initial image recognition model based on the current sample image features of the current sample image and the historical sample image features of the historical sample images, thereby obtaining a target image recognition model with high stability and accuracy. This avoids the problem of a neural network model's ability to recognize old object types declining as new object types continue to increase, as well as the problem of the model's image recognition ability decreasing, thereby improving the accuracy of image recognition results. The above is a schematic diagram of an image recognition model training device in this embodiment. It should be noted that the technical solutions of this image recognition model training device and the technical solutions of the aforementioned image recognition model training method are based on the same concept. Details not described in detail in the technical solution of the image recognition model training device can be found in the description of the technical solution of the aforementioned image recognition model training method. Corresponding to the above-mentioned method embodiment, the present disclosure also provides another embodiment of an image recognition device, which is applied to a cloud-side E-preparation and includes: an acquisition module configured to acquire an image to be recognized sent by a client-side device; a recognition module configured to input the image to be recognized into a target image recognition model to obtain an image recognition result for the image to be recognized, wherein the target image recognition model is obtained by training an initial image recognition model based on current sample image features of a current sample image and historical sample image features of historical sample images, and the initial image recognition model is trained based on the historical sample image features; and a return module configured to return the image recognition result to the client-side device. After acquiring the image to be recognized sent by the client-side device, the image recognition device provided in the present disclosure processes the image to be recognized using the target image recognition model trained using the initial image recognition model based on current sample image features of the current sample image and historical sample image features of historical sample images, thereby obtaining an accurate image recognition result. The accurate image recognition result is then returned to the client-side device, thereby conserving computing resources on the client-side device. Furthermore, because the target image recognition model is obtained by training the initial image recognition model based on the current sample image features of the current sample image and the historical sample image features of the historical sample images, and the initial image recognition model is obtained by training based on the historical sample image features, the target image recognition model avoids the problem of the neural network model's ability to recognize old types of objects decreasing as new types of objects continue to increase, as well as the problem of the model's image recognition ability decreasing, thereby improving the accuracy of image recognition results. The above is an exemplary embodiment of another image recognition device of this embodiment.It should be noted that the technical solution of this alternative image recognition device shares the same concept as the technical solution of the aforementioned alternative image recognition method. For details not described in detail in the technical solution of the alternative image recognition device, please refer to the description of the technical solution of the aforementioned alternative image recognition method. Figure 10 shows a block diagram of a computing device 1000 according to one embodiment of the present disclosure. The components of computing device 1000 include, but are not limited to, a memory 1010 and a processor 1020. Processor 1020 is connected to memory 1010 via a bus 1030, and a database 1050 is configured to store data. Computing device 1000 also includes an access device 1040, which enables computing device 1000 to communicate via one or more networks 1060. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. Access device 1040 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and the like. In one embodiment of the present disclosure, the aforementioned components of computing device 1000 and other components not shown in FIG. 10 may also be connected to each other, for example, via a bus. It should be understood that the computing device structure block diagram shown in FIG. 10 is for illustrative purposes only and does not limit the scope of the present disclosure. Those skilled in the art may add or replace other components as needed. Computing device 1000 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 1000 can also be a mobile or stationary server. Processor 1020 is configured to execute the following computer-executable instructions, which, when executed by processor 920, implement the steps of the above-described two image recognition methods and image recognition model training method. The above is a schematic diagram of a computing device in this embodiment.It should be noted that the technical solution of this computing device is based on the same concept as the two aforementioned image recognition methods and image recognition model training methods. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solutions of the two aforementioned image recognition methods and image recognition model training methods. An embodiment of the present disclosure also provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, these computer-executable instructions implement the steps of the two aforementioned image recognition methods and image recognition model training methods. The above is an exemplary embodiment of a computer-readable storage medium of this embodiment. It should be noted that the technical solution of this storage medium is based on the same concept as the two aforementioned image recognition methods and image recognition model training methods. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solutions of the two aforementioned image recognition methods and image recognition model training methods. An embodiment of the present disclosure also provides a computer program. When executed on a computer, the computer executes the steps of the two aforementioned image recognition methods and image recognition model training methods. The above is an exemplary embodiment of a computer program of this embodiment. It should be noted that the technical solution of this computer program shares the same concept as the technical solutions of the two image recognition methods and image recognition model training methods described above. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solutions of the two image recognition methods and image recognition model training methods described above. The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous. The computer instructions comprise computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased based on the requirements of legislation and patent practice within a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals. It should be noted that, for ease of description, the aforementioned method embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present disclosure are not limited to the order of the actions described, as certain steps may be performed in a different order or simultaneously, depending on the embodiments of the present disclosure. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for the embodiments of the present disclosure. In the above embodiments, the descriptions of each embodiment have their own relevance. For portions not described in detail in a particular embodiment, reference should be made to the relevant descriptions of other embodiments. The preferred embodiments of the present disclosure disclosed above are merely intended to help illustrate the present disclosure. The alternative embodiments do not describe all details in detail, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations are possible based on the content of the embodiments of the present disclosure. This disclosure selects and specifically describes these embodiments to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize the present disclosure. The present disclosure is limited by the claims and their full scope and equivalents. Industrial Applicability: The image recognition method provided in the embodiments of the present disclosure is applied to a cloud testing device. After receiving an image to be recognized, the target image recognition model, obtained by training an initial image recognition model based on the current sample image features of the current sample image and the historical sample image features of historical sample images, is used to process the image to be recognized, thereby obtaining accurate image recognition results. Furthermore, because the target image recognition model is obtained by training the initial image recognition model based on the current sample image features of the current sample image and the historical sample image features of historical sample images, and the initial image recognition model is trained based on the historical sample image features, the target image recognition model avoids the problem of the neural network model's ability to recognize old types of objects decreasing as new types of objects continue to increase, as well as the problem of the model's image recognition ability decreasing, thereby improving the accuracy of image recognition results.
Claims
Claims 1. An image recognition method, comprising: An image to be recognized is received, and the image to be recognized is input into a target image recognition model to obtain an image recognition result of the image to be recognized, wherein the target image recognition model is obtained by training an initial image recognition model according to current sample image features of a current sample image and historical sample image features of historical sample images, and the initial image recognition model is obtained by training according to the historical sample image features.
2. According to the image recognition method of claim 1, the step of inputting the image to be recognized into a target image recognition model to obtain an image recognition result of the image to be recognized comprises: The image to be recognized is input into a target image recognition model, and a feature extraction module in the target image recognition model is used to perform feature extraction on the image to be recognized to obtain image features of the image to be recognized; and an image recognition module in the target image recognition model is used to perform image recognition on the image features to obtain an image recognition result of the image to be recognized.
3. The image recognition method according to claim 1, before receiving the image to be recognized and inputting the image to be recognized into a target image recognition model and obtaining the image recognition result of the image to be recognized, further comprising: Determine a current sample image of the initial image recognition model, and perform feature extraction on the current sample image to obtain features of the current sample image; Acquire historical sample image features of the initial image recognition model, wherein the historical sample image features are image features generated in the process of training the initial image recognition model according to historical sample images; process the historical sample image features and the current sample image features to obtain target sample image features; and train the initial image recognition model based on the target sample image features to obtain a target image recognition model.
4. A method for training an image recognition model, comprising: Determine a current sample image of the initial image recognition model, and perform feature extraction on the current sample image to obtain features of the current sample image; Acquire historical sample image features of the initial image recognition model, wherein the historical sample image features are image features generated in the process of training the initial image recognition model according to historical sample images; process the historical sample image features and the current sample image features to obtain target sample image features; and train the initial image recognition model based on the target sample image features to obtain a target image recognition model.
5. According to the image recognition model training method of claim 4, the step of extracting features from the current sample image to obtain features of the current sample image comprises: The current sample image is input into the initial image recognition model, and a feature extraction module in the initial image recognition model is used to extract features from the current sample image to obtain current sample image features of the current sample image.
6. According to the image recognition model training method of claim 4, the processing of the historical sample image features and the current sample image features to obtain the target sample image features comprises: By using the feature processing module in the initial image recognition model, the historical sample image features and the current sample image features are feature associated. Get the target sample image features.
7. The image recognition model training method according to claim 6, wherein the step of utilizing the feature processing module in the initial image recognition model to perform feature association on the historical sample image features and the current sample image features to obtain the target sample image features comprises: Using the feature processing module in the initial image recognition model, taking the current sample image feature as a query condition, and calculating the similarity coefficient between the historical sample image feature and the query condition; The current sample image feature is weighted by using the similarity coefficient to obtain a weighted feature, and the weighted feature is added to the current sample image feature to obtain a target sample image feature.
8. The image recognition model training method according to claim 4, wherein the step of training the initial image recognition model based on the target sample image features to obtain a target image recognition model comprises: Generate update weights based on the target sample image features, and use the update weights to update the original weights of the initial image recognition model to obtain the image recognition model to be tested; Based on the current test image corresponding to the current sample image, a model test is performed on the image recognition model to be tested. When it is determined that the model test passes, the image recognition model to be tested is determined as a target image recognition model.
9. The image recognition model training method according to claim 8, wherein the step of generating updated weights based on the target sample image features and using the updated weights to update the original weights of the initial image recognition model to obtain the image recognition model to be tested comprises: Inputting the target sample image features into the third feature extraction module of the initial image recognition model to obtain model training features; Calculating the feature mean of the model training feature, and using the feature mean as the update weight; Determine the original weights of the image recognition module in the initial image recognition model, and replace the original weights with the updated weights to obtain the image recognition model to be tested.
10. The image recognition model training method according to claim 8, wherein the step of performing a model test on the image recognition model to be tested based on the current test image corresponding to the current sample image, and determining the image recognition model to be tested as a target image recognition model when the model test passes, comprises: Inputting the current test image corresponding to the current sample image into the to-be-tested image recognition model to obtain a to-be-tested image recognition result of the current test image; and determining the to-be-tested image recognition model as a target image recognition model when it is determined that the test image recognition result satisfies a pre-test pass condition.
11. The image recognition model training method according to claim 6, before the step of using the feature processing module in the initial image recognition model to perform feature association on the historical sample image features and the current sample image features to obtain the target sample image features, further comprising: Determine a training sample corresponding to the feature processing module, and use the training sample to train the feature processing module to obtain a trained feature processing module.
12. According to the image recognition model training method of claim 11, the step of determining the training samples corresponding to the feature processing module and training the feature processing module using the training samples to obtain the trained feature processing module comprises: Determine a training sample corresponding to the feature processing module, and divide the training sample into a first training sample and a second training sample; The feature processing module is trained based on the first training sample to obtain a first loss function; the feature processing module is trained based on the first training sample and the second training sample data to obtain a second loss function; the feature processing module is trained based on the first loss function and the second loss function to obtain a trained feature processing module.
13. An image recognition method, applied to a cloud-side device, comprising: Obtain the image to be recognized sent by the end-side device; Inputting the image to be recognized into a target image recognition model to obtain an image recognition result of the image to be recognized, wherein the target image recognition model is obtained by training an initial image recognition model based on current sample image features of a current sample image and historical sample image features of historical sample images, and the initial image recognition model is obtained by training based on the historical sample image features; and returning the image recognition result to the terminal device.
14. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the image recognition method described in any one of claims 1 to 3, the image recognition model training method described in any one of claims 4 to 12, and the steps of the image recognition method described in claim 13. 19
Citation Information
Patent Citations
Article recognition method and device, vending equipment and computer readable storage medium
CN109711475A
Fundus image classification method and device and computer readable storage medium
CN110399929A
Image classification method and device based on incomplete supervised learning and related equipment
CN112884046A
Image classification method based on multilevel adaptive feature fusion class incremental learning
CN114612721A
Class incremental learning method based on correction of new and old task category confusion
CN114882337A
