Data processing method and device and image processing method and device
By constructing a feature processing network and a feature augmentation method for image classifiers, the problem that models are difficult to cope with dynamic changes in open environments is solved, and accurate prediction and personalized recommendations in unknown categories are achieved.
Patent Information
- Application Number
- CN202510579826.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-10-03
AI Technical Summary
Traditional static model training is unable to cope with the dynamically changing user behavior patterns and product trends in an open environment, resulting in difficulty in recommending newly launched products. In addition, in scenarios with only a small number of user interaction records, the features are insufficient to support accurate personalized push notifications.
Using feature processing networks and image classifiers, an image classification model is constructed through known feature processing units and unknown feature processing units. The perturbation parameters are constructed using the feature distribution of known image categories to enhance the model's classification ability for unknown image categories. Feature augmentation is used to improve the model's prediction ability under unknown categories.
The model's robustness and generalization capabilities in open environments have been improved, enabling it to provide accurate prediction services in data-scarce scenarios and support personalized recommendations.
Smart Images

Figure CN120747573A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of data processing technology, and in particular to data processing methods and devices, and image processing methods and devices. Background Art
[0002] With the development of computer and internet technologies, the convenience of online trading services has attracted more users. With the surge in the number of users and the increasing variety of goods, the rapid growth of data has brought huge challenges to intelligent processing. Especially in open environments, the recall services of online trading platforms need to deal with dynamically changing user behavior patterns and product trends, which makes traditional static model training difficult to effectively cope with in practical applications. For example, there is a cold start problem in actual services, that is, newly launched products are difficult to recommend effectively due to the lack of user interaction data. In scenarios with a small number of user interaction records, the features generated by existing methods are often insufficient to support accurate personalization. The fundamental reason is that traditional machine learning algorithms often assume that the data categories and distribution are known and static, and are difficult to adapt to such open scenarios with unknown data and dynamic changes. This makes it difficult to classify unknown image categories using existing classification models in recall services, which in turn leads to unsatisfactory recommendation effects. Therefore, an effective solution is urgently needed to solve the above problems. Summary of the Invention
[0003] In view of this, embodiments of this specification provide a data processing method. One or more embodiments of this specification also relate to an image processing method, a data processing apparatus, an image processing apparatus, a computing device, a computer-readable storage medium, and a computer program product to address technical deficiencies in the prior art.
[0004] According to a first aspect of an embodiment of this specification, there is provided a data processing method, including:
[0005] Acquiring training data for training an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit;
[0006] Processing the training data using the known feature processing unit to obtain a known image category feature distribution, and constructing a disturbance parameter based on the known image category feature distribution;
[0007] Processing the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution;
[0008] The image classifier is trained based on the known image category feature distribution and the unknown image category feature distribution, and the trained image classifier is used to adjust the parameters of the feature processing network to obtain a target image classification model.
[0009] According to a second aspect of the embodiments of this specification, there is provided an image processing method, including:
[0010] Obtaining a target image associated with a target service, and inputting the target image into a target image classification model, wherein the target image classification model includes a feature processing network and an image classifier, and the target image classification model is determined by the above method;
[0011] Extracting target image features of the target image using the feature processing network, and processing the target image features using the image classifier to obtain a target image category corresponding to the target image;
[0012] The target image is updated based on the image processing information preset by the target service for the target image category. According to a third aspect of the embodiment of this specification, a data processing method is provided, which is applied to a cloud-side device, comprising:
[0013] The receiving end-side device submits training data for an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit;
[0014] Processing the training data using the known feature processing unit to obtain a known image category feature distribution, and constructing a disturbance parameter based on the known image category feature distribution;
[0015] Processing the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution;
[0016] Training the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and adjusting the parameters of the feature processing network using the trained image classifier to obtain a target image classification model;
[0017] The model parameters corresponding to the target image classification model are sent to the end-side device.
[0018] According to a fourth aspect of the embodiments of this specification, there is provided a data processing device, including:
[0019] an acquisition module configured to acquire training data for training an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit;
[0020] a construction module configured to process the training data using the known feature processing unit to obtain a known image category feature distribution, and construct a perturbation parameter according to the known image category feature distribution;
[0021] a processing module configured to process the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution;
[0022] The training module is configured to train the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and use the trained image classifier to adjust the parameters of the feature processing network to obtain a target image classification model.
[0023] According to a fifth aspect of the embodiments of this specification, there is provided an image processing apparatus, including:
[0024] an image acquisition module configured to acquire a target image associated with a target service and input the target image into a target image classification model, wherein the target image classification model includes a feature processing network and an image classifier, and the target image classification model is determined by the above method;
[0025] a feature extraction module configured to extract target image features of the target image using the feature processing network, and process the target image features through the image classifier to obtain a target image category corresponding to the target image;
[0026] The image updating module is configured to update the target image based on image processing information preset by the target service for the target image category.
[0027] According to a sixth aspect of the embodiments of this specification, there is provided a data processing apparatus, applied to a cloud-side device, comprising:
[0028] a data receiving module configured to receive training data submitted by a terminal-side device for an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit;
[0029] a parameter construction module configured to process the training data using the known feature processing unit to obtain a known image category feature distribution, and construct a perturbation parameter according to the known image category feature distribution;
[0030] a data processing module configured to process the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution;
[0031] a training model module configured to train the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and adjust the parameters of the feature processing network using the trained image classifier to obtain a target image classification model;
[0032] The parameter sending module is configured to send the model parameters corresponding to the target image classification model to the terminal side device.
[0033] According to a seventh aspect of the embodiments of this specification, a computing device is provided, including:
[0034] memory and processor;
[0035] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the above-mentioned data processing method or image processing method are implemented.
[0036] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, which implement the steps of the above-mentioned data processing method or image processing method when executed by a processor.
[0037] According to a ninth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program or instructions, which implement the steps of the above-mentioned data processing method or image processing method when executed by a processor.
[0038] The data processing method provided in this embodiment can effectively alleviate the problem of excessive occupation of feature space by unknown categories in an open environment and improve the generalization and robustness of the model. After obtaining training data for training an initial image classification model, it can be determined that the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit. On this basis, the known feature processing unit can be used to process the training data to obtain a feature distribution of known image categories, thereby completing the determination of the feature distribution of known image categories. Thereafter, in order to enable the model to have the ability to classify unknown image categories, perturbation parameters can be constructed based on the known image category feature distribution, and perturbations about unknown image categories can be added through the perturbation parameters. Then, the unknown feature processing unit can be used to process the training data according to the perturbation parameters to obtain the feature distribution of unknown image categories. Furthermore, the image classifier can be trained based on the known image category feature distribution and the unknown image category feature distribution. In order to enable the model to have stronger predictive ability, the trained image classifier can be used to adjust the parameters of the feature processing network to obtain the target image classification model. Feature augmentation is used during the model training phase to improve the model's prediction ability in unknown categories, allowing the model to dynamically estimate the feature distribution of known and unknown categories, thereby improving the robustness of the model in data-scarce scenarios. After being deployed in service scenarios, it can provide accurate prediction services, allowing downstream personalized recommendation processing based on the prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flow chart of a data processing method provided by one embodiment of this specification;
[0040] Figure 2a is a schematic diagram of a feature processing network in a data processing method provided in one embodiment of this specification;
[0041] Figure 2b is a schematic diagram of feature distribution adjustment in a data processing method provided in one embodiment of this specification;
[0042] Figure 3 is a flowchart of an image processing method provided by one embodiment of this specification;
[0043] Figure 4 is a flow chart of another data processing method provided by one embodiment of this specification;
[0044] Figure 5 This is a flowchart of a processing process of an image processing method provided by one embodiment of this specification;
[0045] Figure 6This is a schematic diagram of the structure of a data processing device provided by one embodiment of this specification;
[0046] Figure 7 This is a schematic diagram of the structure of an image processing device provided by one embodiment of this specification;
[0047] Figure 8 is a structural diagram of another data processing device provided by an embodiment of this specification;
[0048] Figure 9 This is a structural block diagram of a computing device provided by one embodiment of this specification. DETAILED DESCRIPTION
[0049] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0050] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0051] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0052] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0053] The image classification model in the technical solution provided in the embodiments of this application can use a deep learning model with a relatively large model parameter scale, such as a large model containing billions or more model parameters. A large model is only an example of a model, and the embodiments of this application do not limit the number of model parameters supported by the adopted deep learning model, with the goal of meeting actual needs.
[0054] First, the terms involved in one or more embodiments of this specification are explained.
[0055] Open environments: Open environments refer to complex scenarios where data distribution and features constantly change over time or under different conditions. In such environments, the distribution and categories of data are often unknown and dynamically changing. Models must be able to handle unseen samples and adapt to new tasks or feature distributions without retraining. This dynamism is often associated with non-stationary distributions, diverse data sources, and potential noise and uncertainty. In open environments, algorithms must possess strong generalization, adaptability, and robustness.
[0056] Curvature Space: Curvature space is a generalization of the concepts of curves and surfaces in three-dimensional Euclidean space, appearing as a space that is locally flat but globally "curved." The degree of this "curvature" is measured by curvature, which is approximately zero. The flatter the space, as in Euclidean space, the curvature is zero everywhere. Conversely, the larger the curvature, the greater the degree of spatial distortion.
[0057] Hyperbolic space: Hyperbolic space is a space with negative constant curvature, meaning that the curvature at any position in the space is negative. Compared to Euclidean space, hyperbolic space has exponentially greater volume capacity, allowing for greater sample spacing for the same amount of storage, making it suitable for modeling very large-scale data. The distance metric in hyperbolic space is equivalent to a power-law distribution, and the two are derived from each other. As a priori understanding of data distribution, it is suitable for modeling scale-free networks. Furthermore, hyperbolic space has a natural ability to model tree-like (hierarchical) structures.
[0058] Manifolds: Manifolds are spaces with locally Euclidean structure, but may exhibit complex topological properties overall. They satisfy two conditions: local Euclidean properties, which state that for every point on the manifold, there exists a neighborhood that is homeomorphic to an open set in Euclidean space (i.e., there exists a continuous bijective mapping whose inverse is also continuous); and topological homeomorphism invariance, which states that two manifolds are homeomorphic if there is a continuous bijective mapping between them and their inverse is also continuous.
[0059] Tangent Space: Tangent Space is a vector space consisting of tangent vectors at a point on a manifold. At each point on the manifold, the tangent space is a vector space that contains the tangent vectors of all curves passing through that point.
[0060] Feature augmentation: Feature augmentation is a method for increasing sample diversity in feature space to alleviate data scarcity. Compared to augmentation methods in the original data space (such as images or text), feature augmentation can more efficiently utilize intrinsic semantic information and visual features while significantly reducing memory overhead. By performing transformations in specific directions in the feature space (which often correspond to meaningful semantic changes), feature augmentation methods can generate richer intra-class variations.
[0061] Wrapped Normal Distribution: The wrapped normal distribution is a probability distribution used to model data in hyperbolic space. Its density function is defined as a normal distribution after a hyperbolic logarithmic mapping, incorporating the geometric properties of hyperbolic space. Compared to the traditional normal distribution, the wrapped normal distribution better captures the geometric properties and data distribution characteristics of hyperbolic space.
[0062] Neural Ordinary Differential Equations (Neural ODEs) are continuous-time models whose core concept is to model the evolution of a state as a continuous process governed by differential equations. The forward propagation of Neural ODEs is considered a discrete form of ordinary differential equations. By introducing a time variable, they can smoothly control the output, providing a more continuous transformation than traditional neural networks. This model can dynamically capture the fine-grained evolution of the state over time, making it particularly well-suited for processing complex structured data.
[0063] This specification provides a data processing method. One or more embodiments of this specification also relate to an image processing method, a data processing apparatus, an image processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, each of which is described in detail in the following embodiments.
[0064] See also Figure 1 , Figure 1 A flow chart of a data processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0065] Step S102: Acquire training data for training an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit.
[0066] The data processing method provided in this embodiment is used for dual feature augmentation of images in hyperbolic space to achieve image classification tasks in open environments. This is mainly due to the complex distribution of image categories in open environments and the presence of a large number of unknown categories. Existing algorithms have difficulty effectively addressing the problem of feature sharing and differentiation between known and unknown categories. To address this problem, a dual feature augmentation strategy in hyperbolic space can be used to augment features of known categories and enhance their representation capabilities. Subsequently, by generating a diverse distribution of unknown category features, the model's adaptability and generalization capabilities on unseen data are improved, thereby achieving more robust classification results in open environments.
[0067] The data processing method provided in this embodiment is illustrated by taking the training process of the initial image classification model in the animal image category classification scenario as an example. The training process of the image classification model in other scenarios can be referred to the description in this embodiment, and this embodiment will not be elaborated here.
[0068] Specifically, the training data refers to the image data used to train the initial image classification model, which can be extracted from a set image data set in the field to which the initial image classification model belongs. For example, if the initial image classification model is applied to a product recommendation scenario, product images can be selected as training data; for example, if the initial image classification model is applied to an animal image classification scenario, animal images can be selected as training data. Accordingly, the initial image classification model refers to a model composed of a feature processing network and an image classifier, the input of the model is an image, and the output is image category information; wherein the feature processing network is used to extract the features of the image, and the image classifier is used to predict the category information corresponding to the image based on the image features; the feature processing network is composed of a known feature processing unit and an unknown feature processing unit, and the network structures of the known feature processing unit and the unknown feature processing unit are the same, both consisting of a fully connected layer, a multi-head attention layer, and a fully connected layer; the known feature processing unit is used to predict the feature distribution of known image categories, and the unknown feature processing unit is used to predict the feature distribution of unknown image categories.
[0069] Based on this, in order to effectively alleviate the problem of excessive occupation of feature space by unknown categories in an open environment and to improve the generalization and robustness of the model, after obtaining the training data for training the initial image classification model, it can be determined that the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit; on this basis, the known feature processing unit can be used to process the training data first to obtain the feature distribution of the known image category and complete the determination of the feature distribution of the known image category. Thereafter, in order to enable the model to have the ability to classify unknown image categories, perturbation parameters can be constructed according to the feature distribution of the known image category to increase the perturbation about the unknown image category through the perturbation parameters, and then the unknown feature processing unit can be used to process the training data according to the perturbation parameters to obtain the feature distribution of the unknown image category; further, the image classifier can be trained based on the feature distribution of the known image category and the feature distribution of the unknown image category, and in order to make the model have stronger prediction ability, the trained image classifier can be used to adjust the parameters of the feature processing network to obtain the target image classification model. Feature augmentation is used during the model training phase to improve the model's prediction ability in unknown categories, allowing the model to dynamically estimate the feature distribution of known and unknown categories, thereby improving the robustness of the model in data-scarce scenarios. After being deployed in service scenarios, it can provide accurate prediction services, allowing downstream personalized recommendation processing based on the prediction results.
[0070] Furthermore, in order to effectively model the feature distribution of data and achieve subsequent accurate feature augmentation in data-scarce scenarios in open environments, modeling can be done in the following manner. In this embodiment, the specific implementation is as follows:
[0071] The training data is sampled according to the normal distribution corresponding to the first tangent space centered on the origin to obtain the initial image low-dimensional features; the initial image low-dimensional features are translated from the first tangent space to the second tangent space centered on the set point to obtain the intermediate image low-dimensional features; the intermediate image low-dimensional features are mapped to the hyperbolic space according to the preset mapping information, and the target image low-dimensional features are obtained according to the mapping results; the feature processing logic between the initial image low-dimensional features and the target image low-dimensional features is determined, and the initial image classification model is constructed according to the feature processing logic.
[0072] Specifically, the first tangent space refers to the tangent space centered on the origin, and the initial image low-dimensional features refer to the vector representation of the low-dimensional description of the image obtained after sampling the training data. The second tangent space refers to the tangent space centered on the set point, which is different from the first tangent space. The intermediate image low-dimensional features refer to the vector representation obtained by translating the initial image low-dimensional features to the second tangent space. The preset mapping information refers to the exponential mapping strategy of the manifold, and the target image low-dimensional features refer to the vector representation corresponding to the image obtained after the mapping process. The feature processing logic is the process logic for processing the low-dimensional features of the image, which is used to model the initial image classification model.
[0073] Based on this, in order to effectively model and achieve precise feature augmentation, the training data can be sampled according to the normal distribution corresponding to the first tangent space centered on the origin to obtain the initial image low-dimensional features. Then, considering that the features have different representations at different locations in the hyperbolic space, it is necessary to translate the initial image low-dimensional features from the first tangent space to the second tangent space centered on the set point to obtain the intermediate image low-dimensional features. Furthermore, in order to achieve feature mapping to the hyperbolic space, the intermediate image low-dimensional features can be mapped to the hyperbolic space according to the preset mapping information, and the target image low-dimensional features can be obtained based on the mapping results. The feature processing logic between the initial image low-dimensional features and the target image low-dimensional features can then be determined to achieve the construction of the initial image classification model based on the feature processing logic.
[0074] That is, when modeling data features, we can use the parcel normal distribution to model image data features based on the geometric properties of hyperbolic space, thereby achieving a more accurate feature distribution approximation under scarce data conditions. The parcel normal distribution can be regarded as the realization of the normal distribution in Euclidean space in hyperbolic space, and its probability density function can be defined by the following formula (1):
[0075]
[0076] Among them, c represents the curvature of the underlying space, μ and ∑ represent the mean and covariance matrix of the augmentation direction respectively, and p is the prototype point of the data, which represents the center of a small number of known data points, which may be biased due to data scarcity.
[0077] Furthermore, the specific implementation of generating feature s from the parcel normal distribution P(c, p, μ, ∑) is as follows:
[0078] (1) Sampling in the tangent space: Sampling in the tangent space T0M centered at the origin d,c Sample a vector v from a normal distribution N(μ,∑).
[0079] (2) Vector translation: You can use the parallel translation operation to move v from the tangent space T0M d,cTranslate to the tangent space TpM centered at p d,c ,get
[0080] (3) Mapping to manifold: Map v back to the hyperbolic manifold M through the exponential mapping of the manifold d,c Then we can get the final feature points
[0081] In addition, since the direct sampling process from the normal distribution N(μ, ∑) is not differentiable, the gradient cannot be returned to the parameters μ and ∑. Therefore, the reparameterization technique can be used to optimize the sampling process. Specifically, the vector ε can be sampled from the standard normal distribution N(0, I) and converted to v, that is, v = μ + Lε, LL T =∑, through this processing operation, the sampling step can be differentiated, thereby supporting the effective return of the gradient to ensure the end-to-end training capability of the modeling process.
[0082] In summary, multi-space mapping optimizes feature representation and significantly improves image classification performance. Initial features are sampled from a normal distribution to ensure global coverage, while tangent space translation enhances local structural adaptability. Hyperbolic space mapping effectively fits the hierarchical distribution of data, improving feature discrimination. This processing logic, through a clear geometric transformation path, optimizes modeling capabilities for complex data distributions, effectively improving classification accuracy and enhancing model robustness.
[0083] Step S104: Process the training data using the known feature processing unit to obtain known image category feature distribution, and construct disturbance parameters according to the known image category feature distribution.
[0084] Specifically, after obtaining the training data and the initial image classification model as described above, in order to enable the model to make predictions on any image category, the feature distribution of known image categories can be estimated first. At this time, the known feature processing unit can be used to process the training data to obtain the feature distribution of known image categories. Before processing the feature distribution of unknown image categories, perturbation parameters can be constructed based on the known image category feature distribution to enable the subsequent combination of perturbation parameters to complete the estimation of the feature distribution of unknown image categories.
[0085] The known image category feature distribution specifically refers to the feature distribution corresponding to the known image category. For example, if the training data includes images of cats, dogs, horses, cows, lions, and tigers, where cat, dog, horse, cow, and lion images are known image categories and tiger images are unknown image categories, then the known image category feature distribution is the feature distribution corresponding to the cat, dog, horse, cow, and lion image categories. Correspondingly, the perturbation parameter specifically refers to the perturbation added to the category distribution when estimating the feature distribution of the unknown image category, and is used to generate the feature distribution of the unknown image category.
[0086] Furthermore, the prediction of the distribution of known image category features can be completed by different subunits in the known feature processing unit. In this embodiment, the specific implementation is as follows:
[0087] The training data is input into the known feature processing unit, wherein the known feature processing unit includes a first subunit, a second subunit and a third subunit; the first subunit, the second subunit and the third subunit are used to process the training data respectively to obtain a known feature distribution curvature, a known feature distribution mean and a known feature distribution covariance corresponding to a known image category; and the known feature distribution curvature, the known feature distribution mean and the known feature distribution covariance are used as the known image category feature distribution.
[0088] Specifically, the first, second, and third subunits refer to the network layers within the known feature processing unit that calculate curvature, mean, and covariance. Each subunit processes a different dimension. Accordingly, the known feature distribution curvature, known feature distribution mean, and known feature distribution covariance refer to the feature representations of the known image class in three dimensions obtained after processing the training data.
[0089] Based on this, when estimating the feature distribution of a known image category, the training data can be input into the known feature processing unit, wherein the known feature processing unit includes a first subunit, a second subunit, and a third subunit; thereafter, the first subunit, the second subunit, and the third subunit can be used to process the training data respectively, thereby obtaining the known feature distribution curvature, the known feature distribution mean, and the known feature distribution covariance corresponding to the known image category according to the processing results; thereafter, the known feature distribution curvature, the known feature distribution mean, and the known feature distribution covariance can be used as the known image category feature distribution for use in subsequent model training.
[0090] In specific implementation, the data processing method provided in this embodiment can perform feature augmentation on n known image categories in the training data. For the distribution of known image categories, its prototype can be obtained by averaging the data, and the curvature, mean and covariance of the distribution can be predicted using the Neural Ordinary Differential Equation (Neural ODE) in combination with the integration process. Among them, all image categories share a unified curvature estimate, and each image category has an independent mean and covariance. For the curvature parameter c in the distribution, it can be estimated by the Neural ODE formula: Among them, the initial value c 0 is a fixed value, T represents the optimization parameter, F1 is the neural network used to estimate the curvature gradient flow, that is, the first subunit, and its gradient is expressed as For the i-th known image category, its mean and covariance are estimated by the following ODE formula (2):
[0091]
[0092] Among them, μ i 0 , L i 0 They are calculated from the mean and initial covariance of the given data respectively. F2 and F3 are neural networks used to estimate the mean and covariance gradient flows, i.e., the second and third subunits, and their gradient forms are
[0093] Specifically, in order to estimate the distribution parameters of a known image category i, a corresponding gradient flow network F, i.e., a feature processing network, can be designed with μ i As an example, the input of the gradient flow network F is μ i and the mean of the samples of this image category The output is The network structure may include Figure 2a The three layers shown in the figure can achieve accurate estimation of the distribution parameters of known image categories under limited data conditions, thereby providing a high-quality distribution basis for feature augmentation.
[0094] In summary, the curvature parameter captures the geometric structure of the data, the mean and covariance characterize the distribution center and diffusion characteristics respectively. The three work together to construct a comprehensive category feature distribution, and subsequent model training can achieve greater robustness to noise interference.
[0095] Step S106: Utilize the unknown feature processing unit to process the training data according to the disturbance parameter to obtain unknown image category feature distribution.
[0096] Specifically, after completing the prediction of the known image category feature distribution as described above, the unknown feature processing unit can be used to process the training data according to the disturbance parameters to obtain the unknown image category feature distribution, so that the known image category feature distribution and the unknown image category feature distribution can be combined to complete the training of the image classification model.
[0097] The feature distribution of unknown image categories specifically refers to the feature distribution corresponding to the unknown image categories. For example, the training data includes images of cats, dogs, horses, cows, lions, and tigers. Among them, the images of cats, dogs, horses, cows, and lions are known image categories, and the images of tigers are unknown image categories. Then the feature distribution of the unknown image category is the feature distribution of tiger images.
[0098] In addition, in order to predict the distribution of unknown image category features, disturbance parameters can be pre-built. In this embodiment, the specific implementation method is as follows:
[0099] Constructing prototype perturbation parameters, mean perturbation parameters and covariance perturbation parameters according to the known image category feature distribution; optimizing the prototype perturbation parameters, mean perturbation parameters and covariance perturbation parameters using the unknown feature processing unit; and using the optimized prototype perturbation parameters, mean perturbation parameters and covariance perturbation parameters as the perturbation parameters.
[0100] Specifically, the prototype perturbation parameter, mean perturbation parameter, and covariance perturbation parameter refer to parameters that make small changes to the prototype, mean, and variance. Optimization of perturbation parameters refers to the calculation of the predicted perturbation direction.
[0101] Based on this, when predicting the feature distribution of unknown image categories, it is necessary to first construct perturbation parameters. Prototype perturbation parameters, mean perturbation parameters, and covariance perturbation parameters can be constructed based on the known image category feature distribution. These parameters are then optimized using the unknown feature processing unit. The optimized prototype perturbation parameters, mean perturbation parameters, and covariance perturbation parameters are then used as perturbation parameters for subsequent use.
[0102] In summary, the parameter perturbation optimization mechanism significantly improves the model's generalization and anti-interference capabilities. By constructing and jointly optimizing the prototype, mean, and covariance perturbation parameters, the model can dynamically adjust the feature distribution boundaries, enhancing its adaptability to unknown categories or noisy data and effectively alleviating overfitting.
[0103] Furthermore, when predicting the distribution of unknown image category features, different sub-units can be used to predict features of different dimensions. In this embodiment, the specific implementation is as follows:
[0104] The training data is input into the unknown feature processing unit, wherein the unknown feature processing unit includes a fourth subunit, a fifth subunit and a sixth subunit; the training data is processed using the fourth subunit, the fifth subunit and the sixth subunit according to the optimized prototype perturbation parameters, the mean perturbation parameters and the covariance perturbation parameters to obtain the unknown feature distribution prototype, the unknown feature distribution mean and the unknown feature distribution covariance corresponding to the unknown image category; the unknown feature distribution prototype, the unknown feature distribution mean and the unknown feature distribution covariance are used as the unknown image category feature distribution.
[0105] Specifically, the fourth subunit, the fifth subunit and the sixth subunit specifically refer to the network layers in the unknown feature processing unit used to calculate the prototype, mean and covariance. The unknown feature distribution prototype, the unknown feature distribution mean and the unknown feature distribution covariance specifically refer to the feature representation of the unknown image category in three dimensions obtained after processing the training data.
[0106] Based on this, the training data is input into the unknown feature processing unit, wherein the unknown feature processing unit includes a fourth subunit, a fifth subunit and a sixth subunit; thereafter, the fourth subunit, the fifth subunit and the sixth subunit can be used to process the training data according to the optimized prototype perturbation parameters, the mean perturbation parameters and the covariance perturbation parameters, thereby obtaining the unknown feature distribution prototype, the unknown feature distribution mean and the unknown feature distribution covariance corresponding to the unknown image category according to the processing results; thereafter, the unknown feature distribution prototype, the unknown feature distribution mean and the unknown feature distribution covariance can be used as the feature distribution of the unknown image category for use in subsequent model training.
[0107] In specific implementation, the estimation of the distribution of unknown image category features can be understood as applying appropriate perturbations to the known image category distribution parameters to generate the distribution of unknown image category features. Specifically, for two known categories i and j, their distributions are expressed as P(c, p i , μ i ,∑ i ) and P(c, p j , μ j ,∑ j ), the neural differential equation can be used to estimate the perturbation direction of the prototype, mean, and covariance, which is uniformly represented as δ. The estimated perturbation direction δ is added to the distribution of the image category to generate a new distribution P(c, p) of the unknown image category k. k , μ k ,∑ k ),like Figure 2b The specific process is as follows:
[0108] (1) Calculation of initial perturbation: The initial perturbation δ can be calculated based on the difference in distribution parameters between known categories i and j. 0 , which includes the initial perturbation of the prototype Initial perturbation of the mean Initial perturbation of the covariance
[0109] (2) Use neural ODE to estimate the perturbation direction. To estimate the perturbation direction of the prototype, mean, and covariance, ODE can be used for T-step optimization, which is expressed as formula (3)
[0110]
[0111] Among them, F4, F5, and F6 are neural networks that estimate the prototype, mean, and covariance gradient flows, namely the fourth, fifth, and sixth subunits, respectively, and their gradient forms are
[0112] (3) Generate the feature distribution of unknown image categories: According to the estimated perturbation direction, the distribution parameter of the unknown image category k can be calculated, which is expressed as the following formula (4):
[0113]
[0114] For example, the initial training data contains n known image categories. Through the above processing, m = n (n-1) / 2 unknown image categories can be generated by pairwise combination, thereby expanding the n-category problem in the current task to an n + m-category problem. By being exposed to more categories of the original distribution during the training process, it is possible to reserve appropriate positions for potential new image categories in the embedding space, avoiding excessive dominance (i.e., filling) of the feature space by known categories. At the same time, it can make the model more accurate in classifying known image categories and unknown image categories, thereby significantly improving the model's discrimination ability.
[0115] In summary, by optimizing the perturbation parameters and jointly modeling the distribution of unknown category features, the model's ability to identify and generalize unknown categories is significantly improved. The perturbed prototype, mean, and covariance parameters are used to accurately characterize the geometric structure and statistical characteristics of unknown category data, effectively alleviating category bias, enhancing the model's adaptability to unseen samples, and reducing its reliance on labeled data.
[0116] Furthermore, after completing the prediction of the feature distribution of known image categories and the feature distribution of unknown image categories, in order to ensure that the hierarchical structure between categories is clearer, feature distribution adjustment can also be performed. In this embodiment, the specific implementation method is as follows:
[0117] Determine a distribution adjustment regularization term that matches the initial image classification model, and add a distribution restriction term to the distribution adjustment regularization term to obtain a target regularization term; use the target regularization term and the distribution adjustment regularization term to adjust the known image category feature distribution and the unknown image category feature distribution; and perform a step of training the image classifier based on the known image category feature distribution and the unknown image category feature distribution according to the adjustment result.
[0118] Specifically, the distribution adjustment regularization term specifically refers to the regularization term that ensures the rationality of the augmented features and maintains the hierarchical structure between categories, and the distribution restriction term specifically refers to the term that controls the position of the distribution of known image category features and the distribution of unknown image category features in the feature space.
[0119] Based on this, in order to ensure that the hierarchical structure between categories is clearer, the distribution adjustment regularization term for the initial image classification model matching can be determined, and the distribution restriction term can be added to the distribution adjustment regularization term to obtain the target regularization term; thereafter, the target regularization term and the distribution adjustment regularization term can be used to adjust the known image category feature distribution and the unknown image category feature distribution; according to the adjustment result, the step of training the image classifier based on the known image category feature distribution and the unknown image category feature distribution can be executed.
[0120] In specific implementation, in order to ensure the rationality of the augmented features and maintain the hierarchical structure between categories, the hierarchical preservation regularization term R can be introduced Hier , considering that the generated unknown image category feature distribution usually has higher uncertainty than the original category, R Hier The uncertainty information of the hyperbolic space can be used to maintain the potential hierarchical relationship between the generated categories and the original categories, ensuring that the categories with higher certainty are near the center of the Poincare sphere, which can be defined by the following formula (5):
[0121] R Hier =2*d c (p k ,0)-d c (p i ,0)-d c (p j ,0)+max(0,(d c γ(p i ,0)+d c (p j ,0))-d c (p k ,0))(5)
[0122] In formula (5), d c (p k ,0) represents the embedding point p of category k k The hyperbolic distance to the origin O of the Poincare sphere is used to measure the uncertainty of this category, which can be expressed by formula (6):
[0123]
[0124] If a category’s features have low classification uncertainty, its embedding point will be far away from the center of the Poincare sphere; if a category’s features have high uncertainty, its embedding point will be closer to the center of the Poincare sphere, for example, Figure 2b In the regularization term R HierBy adjusting the hyperbolic distance, the embedding distance of the generated unknown image category k is forced to be smaller than the embedding distance of the original categories i and j, indicating that the features of category k are more generalized. At the same time, in order to avoid the embedding point of category k being too close to the center of the sphere, a second term is added to the regularization term: max(0,(d c γ(p i ,0)+d c (p j ,0))-d c (p k ,0)), where γ is a hyperparameter that controls the degree of uncertainty of category k. By calculating the regularization term, it is possible to dynamically adjust the hierarchical relationship between the generated categories (unknown image categories) and the original categories (known image categories) during the training process, ensuring that the features of the generated categories occupy a reasonable position in the embedding space and avoid confusion with the original categories. By controlling the hyperbolic distance of the generated categories, the model's ability to distinguish between known and unknown categories is enhanced, which can further improve the model's generalization ability for unknown categories.
[0125] In summary, the dual regularization mechanism significantly improves the classifier's adaptability to both known and unknown categories. The distribution adjustment regularization term constrains model complexity to prevent overfitting, while the distribution restriction term enforces the optimization of the distribution boundaries of category features, enhancing the discrimination between known and unknown categories.
[0126] Step S108: training the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and adjusting the parameters of the feature processing network using the trained image classifier to obtain a target image classification model.
[0127] Specifically, after obtaining the known image category feature distribution and the unknown image category feature distribution as mentioned above, the image classifier can be trained based on the known image category feature distribution and the unknown image category feature distribution. On this basis, in order to ensure that the image classification model has more accurate prediction accuracy, it is also necessary to use the trained image classifier to adjust the parameters of the feature processing network, so as to perform iterative processing to obtain the target image classification model.
[0128] Among them, the target image classification model specifically refers to a model that can accurately predict image categories, which can be deployed in different service scenarios, such as product recommendation scenarios. The target image classification model determined after parameter adjustment refers to the image classifier training and feature processing network optimization, and it is judged whether the image classification model of the current stage meets the training stop condition. If it does not meet the requirements, the above process is repeated for training until the model of a certain stage meets the training stop condition, and the model corresponding to the stage can be used as the target image classification model. Among them, the training stop condition includes but is not limited to the loss value comparison condition, the number of iterations condition or the verification set verification condition, and this embodiment does not impose any restrictions on this.
[0129] Furthermore, when training an image classifier, in order to improve the training effect of the classifier, the classifier can also be trained jointly with augmented feature samples. In this embodiment, the specific implementation is as follows:
[0130] Utilizing the image classifier, characteristic distances between the image feature points corresponding to the training data and the known image category characteristic distribution and the unknown image category characteristic distribution are calculated; the image category corresponding to the training data is determined based on the characteristic distances, and augmented feature samples are sampled from the known image category characteristic distribution and the unknown image category characteristic distribution according to the image category; and the image classifier is jointly trained based on the augmented feature samples and the training data.
[0131] Specifically, feature distance refers to the distance between feature points in hyperbolic space and each image category, and image category refers to the image category information corresponding to the training data. Augmented feature samples refer to the samples obtained after sampling that can be used for image classifier training.
[0132] Based on this, when training an image classifier, in order to ensure sufficient training and accuracy, the image classifier can be used to calculate the feature distance between the image feature points corresponding to the training data and the known image category feature distribution and the unknown image category feature distribution; thereafter, the image category corresponding to the training data can be determined based on the feature distance, and then augmented feature samples can be sampled in the known image category feature distribution and the unknown image category feature distribution according to the image category; finally, the image classifier can be jointly trained based on the augmented feature samples and the training data.
[0133] In specific implementation, in order to improve the learning ability of the image classifier in hyperbolic space, the above-mentioned image feature distribution and sampling can be used to generate infinite feature samples and effectively optimize the performance of the classifier. The specific implementation is as follows:
[0134] (1) Construction based on distance classifier: Design a distance-based classifier W = {w1, ..., w n+m}, where wj ∈M d,c is the weight of the jth class, and the separator calculates the feature x in the hyperbolic space and the weight w of each class j The distance between x and the nearest class is assigned, and the probability that the sample belongs to the jth class is defined as follows:
[0135]
[0136] Among them, y is the prediction result of the classifier.
[0137] (2) Limited sample training and loss function derivation: Sampling features from the feature distributions of known image categories and unknown image categories for joint training. For each category j, from the estimated distribution P(c, p j , μ j ,∑ j ) generates h augmented feature samples The classifier weights are optimized using cross entropy loss, which is achieved through the following formula (8):
[0138]
[0139] (3) Infinite feature generation: Considering that a large sample size (i.e., h→∞) can improve the model's class-invariant learning ability, but complex hyperbolic operations (such as parallel transmission and exponential mapping) increase the computational overhead, we can define the expected form of the cross-entropy loss function to efficiently optimize the classifier while implicitly generating infinite samples. This can be achieved through the following formula (9):
[0140]
[0141] (4) Derivation of the optimization upper bound of the infinite loss function: In order to further improve the training efficiency, the loss function L can be introduced ∞ Upper bound of (W) As an alternative optimization objective, it is achieved by the following formula (10):
[0142]
[0143] Among them, ε is the normalization factor, which is related to the weight vector w j , distribution parameter μ j and covariance matrix ∑ j Related.
[0144] In summary, augmented sampling guided by feature distance and joint training significantly improves the generalization and robustness of the classifier. Feature distances are calculated using known and unknown category distributions to accurately locate sample attribution. Augmented samples are generated based on distributed sampling to compensate for data deficiencies. Joint training strengthens the distinction between category boundaries, effectively improving the model's ability to recognize unknown categories.
[0145] In specific implementation, in order to make the model prediction more accurate and avoid overfitting, the feature processing network can be adjusted after training the classifier. In this embodiment, the specific implementation method is as follows:
[0146] The known image category feature distribution and the unknown image category feature distribution are input into the image classifier for processing to obtain the predicted image category corresponding to the training data; the image classifier is trained according to the sample image category corresponding to the training data and the predicted image category; when the image classifier training is completed, the trained image classifier is used to adjust the parameters of the feature processing network; based on the training results of the image classifier and the parameter adjustment results of the feature processing network, a target image classification model is obtained.
[0147] Specifically, the predicted image category specifically refers to the predicted category output by the image classifier for the training data, and the sample image category specifically refers to the label corresponding to the training data.
[0148] Based on this, the known image category feature distribution and the unknown image category feature distribution are input into the image classifier for processing, and the predicted image category corresponding to the training data can be obtained; at this time, the image classifier can be trained according to the sample image category and the predicted image category corresponding to the training data; until the trained image classifier meets the classifier training stop condition, the trained image classifier can be used to adjust the parameters of the feature processing network; according to the training results of the image classifier and the parameter adjustment results of the feature processing network, the target image classification model that meets the training stop condition can be determined.
[0149] In summary, the dynamic parameter adjustment and joint training mechanism significantly optimizes the collaborative optimization process of feature representation and classification decision making. Iterative training of the classifier and feature processing network enables the model to accurately capture data distribution characteristics. Simultaneously, parameter adjustment of the feature processing network further optimizes feature representation, effectively improving classification accuracy and the ability to identify unknown categories while reducing the risk of overfitting.
[0150] The data processing method provided in this embodiment can effectively alleviate the problem of excessive occupation of feature space by unknown categories in an open environment and improve the generalization and robustness of the model. After obtaining training data for training an initial image classification model, it can be determined that the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit. On this basis, the known feature processing unit can be used to process the training data to obtain a feature distribution of known image categories, thereby completing the determination of the feature distribution of known image categories. Thereafter, in order to enable the model to have the ability to classify unknown image categories, perturbation parameters can be constructed based on the known image category feature distribution, and perturbations about unknown image categories can be added through the perturbation parameters. Then, the unknown feature processing unit can be used to process the training data according to the perturbation parameters to obtain the feature distribution of unknown image categories. Furthermore, the image classifier can be trained based on the known image category feature distribution and the unknown image category feature distribution. In order to enable the model to have stronger predictive ability, the trained image classifier can be used to adjust the parameters of the feature processing network to obtain the target image classification model. Feature augmentation is used during the model training phase to improve the model's prediction ability in unknown categories, allowing the model to dynamically estimate the feature distribution of known and unknown categories, thereby improving the robustness of the model in data-scarce scenarios. After being deployed in service scenarios, it can provide accurate prediction services, allowing downstream personalized recommendation processing based on the prediction results.
[0151] See also Figure 3 , Figure 3 A flowchart of an image processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0152] Step S302: Acquire a target image associated with a target service, and input the target image into a target image classification model, wherein the target image classification model includes a feature processing network and an image classifier, and the target image classification model is determined by the above method.
[0153] Step S304: extracting target image features of the target image using the feature processing network, and processing the target image features through the image classifier to obtain a target image category corresponding to the target image.
[0154] Step S306: updating the target image based on the image processing information preset by the target service for the target image category.
[0155] Any content not described in detail in the image processing method provided in this embodiment can be found in the description of the above embodiments, and this embodiment will not be described in detail here.
[0156] Specifically, the target service refers to the service provided to the user, such as product recommendation, video recommendation, shared content recommendation and other services. Correspondingly, the target image specifically refers to the image that needs to be classified in the current service scenario for use by downstream services. For example, in the product recommendation scenario, by classifying the image, the key attributes such as the brand, color, style, etc. of the product in the image can be determined, and similar products can be recalled and recommended to the user based on visual similarity. Correspondingly, the target image feature specifically refers to the vector expression corresponding to the target image, and the target image category is the category information corresponding to the target image. The preset image processing information specifically refers to the image processing strategy set for the target image category in the target service, such as selecting similar product images for the target image, or retouching the target image, or cropping the target image, etc. Different service scenarios can set different image processing information, and this embodiment does not make too many restrictions here.
[0157] Based on this, after obtaining the target image associated with the target service, the target image can be input into the target image classification model, which includes a feature processing network and an image classifier. The feature processing network can then be used to extract the target image features, which are then processed by the image classifier to obtain the target image category corresponding to the target image. The target image can then be updated based on the image processing information preset by the target service for the target image category.
[0158] For example, when a user searches for similar products through a shopping platform, the platform can receive the captured images uploaded by the user. At this time, the captured images can be input into the image classification model, and the category information of the captured images can be determined through the image classification model. For example, if it is determined that the product in the image belongs to brand A, style B, and color is brown, then similar products can be searched based on the category information. The similar products are then organized into a recommendation list and displayed to the user so that the user can make a purchase.
[0159] In summary, by using the above-trained image classification model to process images in service scenarios, the image classification accuracy can be effectively improved, thereby facilitating the use of downstream services.
[0160] See also Figure 4 , Figure 4 A flowchart of another data processing method provided according to an embodiment of the present specification is shown, which is applied to a cloud-side device and specifically includes the following steps.
[0161] Step S402: receiving training data submitted by the end-side device for the initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit.
[0162] Step S404: Process the training data using the known feature processing unit to obtain known image category feature distribution, and construct disturbance parameters according to the known image category feature distribution.
[0163] Step S406: Utilize the unknown feature processing unit to process the training data according to the disturbance parameter to obtain unknown image category feature distribution.
[0164] Step S408: training the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and adjusting the parameters of the feature processing network using the trained image classifier to obtain a target image classification model.
[0165] Step S410: Send the model parameters corresponding to the target image classification model to the terminal-side device.
[0166] Another data processing method provided in this embodiment is applied to a cloud-side device. The cloud-side device is a device that provides model training services to the end-side device. It can automatically train the image classification model based on the training data submitted by the end-side device. After training is completed, the cloud-side device feeds back the trained model parameters to the end-side device, which is then deployed in the service scenario. The specific training process of the image classification model can be found in the description of the data processing method in the above embodiment, and this embodiment will not elaborate on this.
[0167] The following combined Figure 5 , taking the application of the image processing method provided in this specification in the image classification scenario as an example, the image processing method is further explained. Figure 5 A flowchart of a processing process of an image processing method provided by an embodiment of this specification is shown, which specifically includes the following steps.
[0168] In step S502, the training data is sampled according to the normal distribution corresponding to the first tangent space centered on the origin to obtain the initial image low-dimensional features, and the initial image low-dimensional features are translated from the first tangent space to the second tangent space centered on the set point to obtain the intermediate image low-dimensional features.
[0169] Step S504: Map the low-dimensional features of the intermediate image to the hyperbolic space according to the preset mapping information, obtain the low-dimensional features of the target image according to the mapping results, determine the feature processing logic between the low-dimensional features of the initial image and the low-dimensional features of the target image, and construct the initial image classification model according to the feature processing logic.
[0170] When modeling data features, we can use the parcel normal distribution to model image data features based on the geometric properties of hyperbolic space, thereby achieving a more accurate feature distribution approximation under scarce data conditions. The parcel normal distribution can be regarded as the realization of the normal distribution in Euclidean space in hyperbolic space, and its probability density function can be defined by the following formula (1):
[0171]
[0172] Among them, c represents the curvature of the underlying space, μ and ∑ represent the mean and covariance matrix of the augmentation direction respectively, and p is the prototype point of the data, which represents the center of a small number of known data points, which may be biased due to data scarcity.
[0173] Furthermore, the specific implementation of generating feature s from the parcel normal distribution P(c, p, μ, ∑) is as follows:
[0174] (1) Sampling in the tangent space: Sampling in the tangent space T0M centered at the origin d,c Sample a vector v from a normal distribution N(μ,∑).
[0175] (2) Vector translation: You can use the parallel translation operation to move v from the tangent space T0M d,c Translate to the tangent space TpM centered at p d,c ,get
[0176] (3) Mapping to manifold: Map v back to the hyperbolic manifold M through the exponential mapping of the manifold d,c Then we can get the final feature points
[0177] In addition, since the direct sampling process from the normal distribution N(μ, ∑) is not differentiable, the gradient cannot be returned to the parameters μ and ∑. Therefore, the reparameterization technique can be used to optimize the sampling process. Specifically, the vector ε can be sampled from the standard normal distribution N(0, I) and converted to v, that is, v = μ + Lε, LL T =∑, through this processing operation, the sampling step can be differentiated, thereby supporting the effective return of the gradient to ensure the end-to-end training capability of the modeling process.
[0178] Step S506: Acquire training data for training an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit.
[0179] Step S508: input the training data into a known feature processing unit, wherein the known feature processing unit includes a first subunit, a second subunit, and a third subunit. The first subunit, the second subunit, and the third subunit are used to process the training data respectively to obtain the known feature distribution curvature, the known feature distribution mean, and the known feature distribution covariance corresponding to the known image category.
[0180] In step S510 , the known feature distribution curvature, the known feature distribution mean, and the known feature distribution covariance are used as the known image category feature distribution, and prototype perturbation parameters, mean perturbation parameters, and covariance perturbation parameters are constructed according to the known image category feature distribution.
[0181] In specific implementation, the data processing method provided in this embodiment can perform feature augmentation on n known image categories in the training data. For the distribution of known image categories, its prototype can be obtained by averaging the data, and the curvature, mean and covariance of the distribution can be predicted using the Neural Ordinary Differential Equation (Neural ODE) in combination with the integration process. Among them, all image categories share a unified curvature estimate, and each image category has an independent mean and covariance. For the curvature parameter c in the distribution, it can be estimated by the Neural ODE formula: Among them, the initial value c 0 is a fixed value, T represents the optimization parameter, F1 is the neural network used to estimate the curvature gradient flow, that is, the first subunit, and its gradient is expressed as For the i-th known image category, its mean and covariance are estimated by the following ODE formula (2):
[0182]
[0183] Among them, μ i 0 , L i 0 They are calculated from the mean and initial covariance of the given data respectively. F2 and F3 are neural networks used to estimate the mean and covariance gradient flows, i.e., the second and third subunits, and their gradient forms are
[0184] Specifically, in order to estimate the distribution parameters of a known image category i, a corresponding gradient flow network F, i.e., a feature processing network, can be designed with μ i As an example, the input of the gradient flow network F is μ i and the mean of the samples of this image category The output is The network structure may include Figure 2aThe three layers shown in the figure can achieve accurate estimation of the distribution parameters of known image categories under limited data conditions, thereby providing a high-quality distribution basis for feature augmentation.
[0185] Step S512: Utilize the unknown feature processing unit to optimize the prototype disturbance parameter, the mean disturbance parameter, and the covariance disturbance parameter, and use the optimized prototype disturbance parameter, the mean disturbance parameter, and the covariance disturbance parameter as disturbance parameters.
[0186] Step S514: input the training data into the unknown feature processing unit, wherein the unknown feature processing unit includes a fourth subunit, a fifth subunit, and a sixth subunit.
[0187] Step S516: Use the fourth subunit, the fifth subunit, and the sixth subunit to process the training data according to the optimized prototype perturbation parameters, mean perturbation parameters, and covariance perturbation parameters to obtain the unknown feature distribution prototype, unknown feature distribution mean, and unknown feature distribution covariance corresponding to the unknown image category.
[0188] In step S518 , the unknown feature distribution prototype, the unknown feature distribution mean, and the unknown feature distribution covariance are used as the unknown image category feature distribution.
[0189] In specific implementation, the estimation of the distribution of unknown image category features can be understood as applying appropriate perturbations to the known image category distribution parameters to generate the distribution of unknown image category features. Specifically, for two known categories i and j, their distributions are expressed as P(c, p i , μ i ,∑ i ) and P(c, p j , μ j ,∑ j ), the neural differential equation can be used to estimate the perturbation direction of the prototype, mean, and covariance, which is uniformly represented as δ. The estimated perturbation direction δ is added to the distribution of the image category to generate a new distribution P(c, p) of the unknown image category k. k , μ k ,∑ k ),like Figure 2b The specific process is as follows:
[0190] (1) Calculation of initial perturbation: The initial perturbation δ can be calculated based on the difference in distribution parameters between known categories i and j. 0 , which includes the initial perturbation of the prototype Initial perturbation of the mean Initial perturbation of the covariance
[0191] (2) Use neural ODE to estimate the perturbation direction. To estimate the perturbation direction of the prototype, mean, and covariance, ODE can be used for T-step optimization, which is expressed as formula (3)
[0192]
[0193] Among them, F4, F5, and F6 are neural networks that estimate the prototype, mean, and covariance gradient flows, namely the fourth, fifth, and sixth subunits, respectively, and their gradient forms are
[0194] (3) Generate the feature distribution of unknown image categories: According to the estimated perturbation direction, the distribution parameter of the unknown image category k can be calculated, which is expressed as the following formula (4):
[0195]
[0196] For example, the initial training data contains n known image categories. Through the above processing, m = n (n-1) / 2 unknown image categories can be generated by pairwise combination, thereby expanding the n-category problem in the current task to an n + m-category problem. By being exposed to more categories of the original distribution during the training process, it is possible to reserve appropriate positions for potential new image categories in the embedding space, avoiding excessive dominance (i.e., filling) of the feature space by known categories. At the same time, it can make the model more accurate in classifying known image categories and unknown image categories, thereby significantly improving the model's discrimination ability.
[0197] Step S520, determine the distribution adjustment regularization term that matches the initial image classification model, and add a distribution restriction term to the distribution adjustment regularization term to obtain a target regularization term, and use the target regularization term and the distribution adjustment regularization term to adjust the known image category feature distribution and the unknown image category feature distribution.
[0198] In specific implementation, in order to ensure the rationality of the augmented features and maintain the hierarchical structure between categories, the hierarchical preservation regularization term R can be introduced Hier , considering that the generated unknown image category feature distribution usually has higher uncertainty than the original category, R Hier The uncertainty information of the hyperbolic space can be used to maintain the potential hierarchical relationship between the generated categories and the original categories, ensuring that the categories with higher certainty are near the center of the Poincare sphere, which can be defined by the following formula (5):
[0199] R Hier =2*d c (p k ,0)-d c (p i ,0)-d c (pj ,0)+max(0,(d c γ(p i ,0)+d c (p j ,0))-d c (p k ,0))(5)
[0200] In formula (5), d c (p k ,0) represents the embedding point p of category k k The hyperbolic distance to the origin O of the Poincare sphere is used to measure the uncertainty of this category, which can be expressed by formula (6):
[0201]
[0202] If a category’s features have low classification uncertainty, its embedding point will be far away from the center of the Poincare sphere; if a category’s features have high uncertainty, its embedding point will be closer to the center of the Poincare sphere, for example, Figure 2b In the regularization term R Hier By adjusting the hyperbolic distance, the embedding distance of the generated unknown image category k is forced to be smaller than the embedding distance of the original categories i and j, indicating that the features of category k are more generalized. At the same time, in order to avoid the embedding point of category k being too close to the center of the sphere, a second term is added to the regularization term: max(0,(d c γ(p i ,0)+d c (p j ,0))-d c (p k ,0)), where γ is a hyperparameter that controls the degree of uncertainty of category k. By calculating the regularization term, it is possible to dynamically adjust the hierarchical relationship between the generated categories (unknown image categories) and the original categories (known image categories) during the training process, ensuring that the features of the generated categories occupy a reasonable position in the embedding space and avoid confusion with the original categories. By controlling the hyperbolic distance of the generated categories, the model's ability to distinguish between known and unknown categories is enhanced, which can further improve the model's generalization ability for unknown categories.
[0203] Step S522: Calculate the feature distance between the image feature points corresponding to the training data and the known image category feature distribution and the unknown image category feature distribution using an image classifier based on the adjustment result, determine the image category corresponding to the training data based on the feature distance, and sample augmented feature samples in the known image category feature distribution and the unknown image category feature distribution according to the image category.
[0204] Step S524: jointly train the image classifier based on the augmented feature samples and the training data, and use the trained image classifier to adjust the parameters of the feature processing network until a target image classification model that meets the training stop conditions is obtained.
[0205] In specific implementation, in order to improve the learning ability of the image classifier in hyperbolic space, the above-mentioned image feature distribution and sampling can be used to generate infinite feature samples and effectively optimize the performance of the classifier. The specific implementation is as follows:
[0206] (1) Construction based on distance classifier: Design a distance-based classifier W = {w1, ..., w n+m}, where w j ∈M d,c is the weight of the jth class, and the separator calculates the feature x in the hyperbolic space and the weight w of each class j The distance between x and the nearest class is assigned, and the probability that the sample belongs to the jth class is defined as follows:
[0207]
[0208] Among them, y is the prediction result of the classifier.
[0209] (2) Limited sample training and loss function derivation: Sampling features from the feature distributions of known image categories and unknown image categories for joint training. For each category j, from the estimated distribution P(c, p j , μ j ,∑ j ) generates h augmented feature samples The classifier weights are optimized using cross entropy loss, which is achieved through the following formula (8):
[0210]
[0211] (3) Infinite feature generation: Considering that a large sample size (i.e., h→∞) can improve the model's class-invariant learning ability, but complex hyperbolic operations (such as parallel transmission and exponential mapping) increase the computational overhead, we can define the expected form of the cross-entropy loss function to efficiently optimize the classifier while implicitly generating infinite samples. This can be achieved through the following formula (9):
[0212]
[0213] (4) Derivation of the optimization upper bound of the infinite loss function: In order to further improve the training efficiency, the loss function L can be introduced ∞ Upper bound of (W) As an alternative optimization objective, it is achieved by the following formula (10):
[0214]
[0215] Among them, ε is the normalization factor, which is related to the weight vector w j , distribution parameter μ j and covariance matrix ∑ j Related.
[0216] Step S526, when the target image associated with the target service is received, the target image is input into the target image classification model, the target image features of the target image are extracted using the feature processing network in the target image classification model, and the target image features are processed by the image classifier in the target image classification model.
[0217] Step S528 : determining the target image category corresponding to the target image according to the processing result, and adding the target image to the preset image set based on the image processing information preset by the target service for the target image category.
[0218] For example, if the target image is determined to be a clothing product image through an image classification model, the target image can be stored in a clothing product image collection. When recommending clothing products to users, the images in the collection can be used as recommended homepage clothing product images, making it easier for users to browse.
[0219] Alternatively, if the target image is determined to be a product introduction image through an image classification model, the product introduction image can be stored in an image collection corresponding to the target product. When building a product details page for the target product, the image can be selected from the collection to facilitate users browsing the product details page of the target product.
[0220] To sum up, in order to effectively alleviate the problem of excessive occupation of feature space by unknown categories in an open environment and improve the generalization ability and robustness of the model, after obtaining the training data for training the initial image classification model, it can be determined that the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit; on this basis, the known feature processing unit can be used to process the training data first to obtain the feature distribution of the known image category and complete the feature distribution determination of the known image category. Thereafter, in order to enable the model to have the ability to classify unknown image categories, perturbation parameters can be constructed according to the known image category feature distribution to increase the perturbation about the unknown image category through the perturbation parameters, and then the unknown feature processing unit can be used to process the training data according to the perturbation parameters to obtain the feature distribution of the unknown image category; further, the image classifier can be trained based on the known image category feature distribution and the unknown image category feature distribution, and in order to make the model have stronger prediction ability, the trained image classifier can be used to adjust the parameters of the feature processing network to obtain the target image classification model. Feature augmentation is used during the model training phase to improve the model's prediction ability in unknown categories, allowing the model to dynamically estimate the feature distribution of known and unknown categories, thereby improving the robustness of the model in data-scarce scenarios. After being deployed in service scenarios, it can provide accurate prediction services, allowing downstream personalized recommendation processing based on the prediction results.
[0221] Corresponding to the above method embodiment, this specification also provides a data processing device embodiment, Figure 6 FIG1 shows a schematic diagram of the structure of a data processing device provided by an embodiment of this specification. Figure 6 As shown, the device includes:
[0222] An acquisition module 602 is configured to acquire training data for training an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit;
[0223] A construction module 604 is configured to process the training data using the known feature processing unit to obtain a known image category feature distribution, and construct a perturbation parameter according to the known image category feature distribution;
[0224] A processing module 606 is configured to process the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution;
[0225] The training module 608 is configured to train the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and use the trained image classifier to adjust the parameters of the feature processing network to obtain a target image classification model.
[0226] In an optional embodiment, before the step of obtaining training data for training the initial image classification model is performed, the method further includes:
[0227] The training data is sampled according to the normal distribution corresponding to the first tangent space centered on the origin to obtain the initial image low-dimensional features; the initial image low-dimensional features are translated from the first tangent space to the second tangent space centered on the set point to obtain the intermediate image low-dimensional features; the intermediate image low-dimensional features are mapped to the hyperbolic space according to the preset mapping information, and the target image low-dimensional features are obtained according to the mapping results; the feature processing logic between the initial image low-dimensional features and the target image low-dimensional features is determined, and the initial image classification model is constructed according to the feature processing logic.
[0228] In an optional embodiment, the using the known feature processing unit to process the training data to obtain a known image category feature distribution includes:
[0229] The training data is input into the known feature processing unit, wherein the known feature processing unit includes a first subunit, a second subunit and a third subunit; the first subunit, the second subunit and the third subunit are used to process the training data respectively to obtain a known feature distribution curvature, a known feature distribution mean and a known feature distribution covariance corresponding to a known image category; and the known feature distribution curvature, the known feature distribution mean and the known feature distribution covariance are used as the known image category feature distribution.
[0230] In an optional embodiment, constructing a disturbance parameter according to the known image category feature distribution includes:
[0231] Constructing prototype perturbation parameters, mean perturbation parameters and covariance perturbation parameters according to the known image category feature distribution; optimizing the prototype perturbation parameters, mean perturbation parameters and covariance perturbation parameters using the unknown feature processing unit; and using the optimized prototype perturbation parameters, mean perturbation parameters and covariance perturbation parameters as the perturbation parameters.
[0232] In an optional embodiment, the step of processing the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution includes:
[0233] The training data is input into the unknown feature processing unit, wherein the unknown feature processing unit includes a fourth subunit, a fifth subunit and a sixth subunit; the training data is processed using the fourth subunit, the fifth subunit and the sixth subunit according to the optimized prototype perturbation parameters, the mean perturbation parameters and the covariance perturbation parameters to obtain the unknown feature distribution prototype, the unknown feature distribution mean and the unknown feature distribution covariance corresponding to the unknown image category; the unknown feature distribution prototype, the unknown feature distribution mean and the unknown feature distribution covariance are used as the unknown image category feature distribution.
[0234] In an optional embodiment, before executing the step of training the image classifier based on the known image category feature distribution and the unknown image category feature distribution, the method further includes:
[0235] Determine a distribution adjustment regularization term that matches the initial image classification model, and add a distribution restriction term to the distribution adjustment regularization term to obtain a target regularization term; use the target regularization term and the distribution adjustment regularization term to adjust the known image category feature distribution and the unknown image category feature distribution; and perform a step of training the image classifier based on the known image category feature distribution and the unknown image category feature distribution according to the adjustment result.
[0236] In an optional embodiment, the training of the image classifier based on the known image category feature distribution and the unknown image category feature distribution includes:
[0237] Utilizing the image classifier, characteristic distances between the image feature points corresponding to the training data and the known image category characteristic distribution and the unknown image category characteristic distribution are calculated; the image category corresponding to the training data is determined based on the characteristic distances, and augmented feature samples are sampled from the known image category characteristic distribution and the unknown image category characteristic distribution according to the image category; and the image classifier is jointly trained based on the augmented feature samples and the training data.
[0238] In an optional embodiment, the image classifier is trained based on the known image category feature distribution and the unknown image category feature distribution, and the trained image classifier is used to adjust the parameters of the feature processing network to obtain a target image classification model, including:
[0239] The known image category feature distribution and the unknown image category feature distribution are input into the image classifier for processing to obtain the predicted image category corresponding to the training data; the image classifier is trained according to the sample image category corresponding to the training data and the predicted image category; when the image classifier training is completed, the trained image classifier is used to adjust the parameters of the feature processing network; based on the training results of the image classifier and the parameter adjustment results of the feature processing network, a target image classification model is obtained.
[0240] The data processing device provided in this embodiment can, in order to effectively alleviate the problem of excessive occupation of feature space by unknown categories in an open environment and improve the generalization ability and robustness of the model, determine, after obtaining training data for training the initial image classification model, that the initial image classification model includes a feature processing network and an image classifier, and that the feature processing network includes a known feature processing unit and an unknown feature processing unit. On this basis, the known feature processing unit can be used to process the training data first to obtain a feature distribution of known image categories, thereby completing the determination of the feature distribution of known image categories. Thereafter, in order to enable the model to have the ability to classify unknown image categories, perturbation parameters can be constructed based on the known image category feature distribution, thereby increasing perturbations regarding unknown image categories through the perturbation parameters. The training data can then be processed by the unknown feature processing unit according to the perturbation parameters to obtain a feature distribution of unknown image categories. Furthermore, the image classifier can be trained based on the known image category feature distribution and the unknown image category feature distribution. In order to enable the model to have stronger predictive ability, the trained image classifier can be used to adjust the parameters of the feature processing network to obtain a target image classification model. Feature augmentation is used during the model training phase to improve the model's prediction ability in unknown categories, allowing the model to dynamically estimate the feature distribution of known and unknown categories, thereby improving the robustness of the model in data-scarce scenarios. After being deployed in service scenarios, it can provide accurate prediction services, allowing downstream personalized recommendation processing based on the prediction results.
[0241] The above is a schematic diagram of a data processing device according to this embodiment. It should be noted that the technical solution of the data processing device and the technical solution of the above-mentioned data processing method are based on the same concept. For details not described in detail in the technical solution of the data processing device, please refer to the description of the technical solution of the above-mentioned data processing method.
[0242] Corresponding to the above method embodiment, this specification also provides an image processing device embodiment, Figure 7 FIG. 1 shows a schematic diagram of the structure of an image processing device provided by an embodiment of this specification. Figure 7 As shown, the device includes:
[0243] An image acquisition module 702 is configured to acquire a target image associated with a target service and input the target image into a target image classification model, wherein the target image classification model includes a feature processing network and an image classifier, and the target image classification model is determined by the above method;
[0244] A feature extraction module 704 is configured to extract target image features of the target image using the feature processing network, and process the target image features through the image classifier to obtain a target image category corresponding to the target image;
[0245] The image updating module 706 is configured to update the target image based on the image processing information preset by the target service for the target image category.
[0246] The above is a schematic diagram of an image processing device according to this embodiment. It should be noted that the technical solution of the image processing device and the technical solution of the above-mentioned image processing method are based on the same concept. For details not described in detail in the technical solution of the image processing device, please refer to the description of the technical solution of the above-mentioned image processing method.
[0247] Corresponding to the above method embodiment, this specification also provides another data processing device embodiment, Figure 8 FIG. 1 shows a schematic diagram of the structure of another data processing device provided by an embodiment of this specification. Figure 8 As shown, the device is applied to cloud-side equipment and includes:
[0248] A data receiving module 802 is configured to receive training data submitted by a terminal-side device for an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit;
[0249] A parameter construction module 804 is configured to process the training data using the known feature processing unit to obtain a known image category feature distribution, and construct a perturbation parameter based on the known image category feature distribution;
[0250] a data processing module 806 configured to process the training data according to the disturbance parameters using the unknown feature processing unit to obtain an unknown image category feature distribution;
[0251] A training model module 808 is configured to train the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and adjust the parameters of the feature processing network using the trained image classifier to obtain a target image classification model;
[0252] The parameter sending module 810 is configured to send the model parameters corresponding to the target image classification model to the terminal side device.
[0253] The above is a schematic diagram of another data processing device of this embodiment. It should be noted that the technical solution of this data processing device and the technical solution of the above-mentioned data processing method are based on the same concept. For details not described in detail in the technical solution of the data processing device, please refer to the description of the technical solution of the above-mentioned data processing method.
[0254] Figure 9 The block diagram of a computing device 900 according to one embodiment of the present disclosure is shown. Components of the computing device 900 include, but are not limited to, a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and a database 950 is used to store data.
[0255] The computing device 900 also includes an access device 940 that enables the computing device 900 to communicate via one or more networks 960. Examples of such 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. The access device 940 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, 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, or a near field communication (NFC) interface.
[0256] In one embodiment of the present specification, the above components of the computing device 900 and Figure 9 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 9The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.
[0257] The computing device 900 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook computer, 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 a personal computer (PC). The computing device 900 may also be a mobile or stationary server.
[0258] The processor 920 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-mentioned data processing method or image processing method.
[0259] The above is a schematic diagram of a computing device according to this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the aforementioned data processing method or image processing method are based on the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the aforementioned data processing method or image processing method.
[0260] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned data processing method or image processing method.
[0261] The above is a schematic diagram of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium is based on the same concept as the technical solution of the aforementioned data processing method or image processing method. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the aforementioned data processing method or image processing method.
[0262] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data processing method or image processing method.
[0263] The above is an illustrative embodiment of a computer program. It should be noted that the technical solution of the computer program and the technical solution of the aforementioned data processing method or image processing method are based on the same concept. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solution of the aforementioned data processing method or image processing method.
[0264] An embodiment of the present specification further provides a computer program product, including a computer program or instructions, which implement the steps of the above-mentioned data processing method or image processing method when executed by a processor.
[0265] The above is a schematic diagram of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the aforementioned data processing method or image processing method are based on the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the aforementioned data processing method or image processing method.
[0266] The foregoing description of this specification describes specific embodiments. 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 shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0267] The computer instructions include 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), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0268] It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0269] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0270] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A data processing method, comprising: Acquiring training data for training an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit; Processing the training data using the known feature processing unit to obtain a known image category feature distribution, and constructing a disturbance parameter based on the known image category feature distribution; Processing the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution; The image classifier is trained based on the known image category feature distribution and the unknown image category feature distribution, and the trained image classifier is used to adjust the parameters of the feature processing network to obtain a target image classification model.
2. The data processing method according to claim 1, before executing the step of obtaining training data for training the initial image classification model, further comprising: Sampling the training data according to the normal distribution corresponding to the first tangent space centered at the origin to obtain initial image low-dimensional features; translating the initial image low-dimensional features from the first tangent space to a second tangent space centered at a set point to obtain intermediate image low-dimensional features; Mapping the low-dimensional features of the intermediate image to a hyperbolic space according to preset mapping information, and obtaining the low-dimensional features of the target image according to the mapping result; Determine the feature processing logic between the low-dimensional features of the initial image and the low-dimensional features of the target image, and construct the initial image classification model according to the feature processing logic.
3. The data processing method according to claim 1, wherein the step of processing the training data using the known feature processing unit to obtain a known image category feature distribution comprises: Inputting the training data into the known feature processing unit, wherein the known feature processing unit includes a first subunit, a second subunit, and a third subunit; Using the first subunit, the second subunit, and the third subunit to process the training data respectively to obtain a known feature distribution curvature, a known feature distribution mean, and a known feature distribution covariance corresponding to a known image category; The known feature distribution curvature, the known feature distribution mean and the known feature distribution covariance are used as the known image category feature distribution.
4. The data processing method according to claim 1, wherein constructing the disturbance parameter according to the known image category feature distribution comprises: Constructing prototype perturbation parameters, mean perturbation parameters and covariance perturbation parameters according to the known image category feature distribution; Utilizing the unknown feature processing unit to optimize the prototype disturbance parameter, the mean disturbance parameter, and the covariance disturbance parameter; The optimized prototype disturbance parameter, mean disturbance parameter and covariance disturbance parameter are used as the disturbance parameters.
5. The data processing method according to claim 4, wherein the step of processing the training data according to the disturbance parameter using the unknown feature processing unit to obtain the unknown image category feature distribution comprises: Inputting the training data into the unknown feature processing unit, wherein the unknown feature processing unit includes a fourth subunit, a fifth subunit, and a sixth subunit; Using the fourth subunit, the fifth subunit, and the sixth subunit, the training data is processed according to the optimized prototype perturbation parameter, the mean perturbation parameter, and the covariance perturbation parameter to obtain an unknown feature distribution prototype, an unknown feature distribution mean, and an unknown feature distribution covariance corresponding to an unknown image category; The unknown feature distribution prototype, the unknown feature distribution mean and the unknown feature distribution covariance are used as the unknown image category feature distribution.
6. The data processing method according to claim 1, before executing the step of training the image classifier based on the known image category feature distribution and the unknown image category feature distribution, further comprising: Determining a distribution adjustment regularization term matched by the initial image classification model, and adding a distribution restriction term to the distribution adjustment regularization term to obtain a target regularization term; Using the target regularization term and the distribution adjustment regularization term, adjusting the known image category feature distribution and the unknown image category feature distribution; The step of training the image classifier based on the known image category feature distribution and the unknown image category feature distribution is performed according to the adjustment result.
7. The data processing method according to claim 1, wherein the training of the image classifier based on the known image category feature distribution and the unknown image category feature distribution comprises: Utilizing the image classifier, calculating feature distances between the image feature points corresponding to the training data and the known image category feature distribution and the unknown image category feature distribution; Determining the image category corresponding to the training data according to the feature distance, and sampling augmented feature samples in the known image category feature distribution and the unknown image category feature distribution according to the image category; The image classifier is jointly trained based on the augmented feature samples and the training data.
8. The data processing method according to claim 1, wherein the image classifier is trained based on the known image category feature distribution and the unknown image category feature distribution, and the trained image classifier is used to adjust the parameters of the feature processing network to obtain a target image classification model, comprising: Inputting the known image category feature distribution and the unknown image category feature distribution into the image classifier for processing to obtain the predicted image category corresponding to the training data; Training the image classifier according to the sample image category corresponding to the training data and the predicted image category; When the image classifier training is completed, the trained image classifier is used to adjust the parameters of the feature processing network; The target image classification model is obtained based on the training results of the image classifier and the parameter adjustment results of the feature processing network.
9. An image processing method, comprising: Obtaining a target image associated with a target service, and inputting the target image into a target image classification model, wherein the target image classification model includes a feature processing network and an image classifier, and the target image classification model is determined by the method of any one of claims 1 to 8; Extracting target image features of the target image using the feature processing network, and processing the target image features using the image classifier to obtain a target image category corresponding to the target image; The target image is updated based on image processing information preset by the target service for the target image category.
10. A data processing method, applied to a cloud-side device, comprising: The receiving end-side device submits training data for an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit; Processing the training data using the known feature processing unit to obtain a known image category feature distribution, and constructing a disturbance parameter based on the known image category feature distribution; Processing the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution; Training the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and adjusting the parameters of the feature processing network using the trained image classifier to obtain a target image classification model; The model parameters corresponding to the target image classification model are sent to the end-side device.
11. A data processing device comprising: an acquisition module configured to acquire training data for training an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit; a construction module configured to process the training data using the known feature processing unit to obtain a known image category feature distribution, and construct a perturbation parameter according to the known image category feature distribution; a processing module configured to process the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution; The training module is configured to train the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and use the trained image classifier to adjust the parameters of the feature processing network to obtain a target image classification model.
12. An image processing device, comprising: an image acquisition module configured to acquire a target image associated with a target service and input the target image into a target image classification model, wherein the target image classification model includes a feature processing network and an image classifier, and the target image classification model is determined by the method of any one of claims 1 to 8; a feature extraction module configured to extract target image features of the target image using the feature processing network, and process the target image features through the image classifier to obtain a target image category corresponding to the target image; The image updating module is configured to update the target image based on image processing information preset by the target service for the target image category.
13. A data processing device, applied to a cloud-side device, comprising: a data receiving module configured to receive training data submitted by a terminal-side device for an initial image classification model, wherein the initial image classification model includes a feature processing network and an image classifier, and the feature processing network includes a known feature processing unit and an unknown feature processing unit; a parameter construction module configured to process the training data using the known feature processing unit to obtain a known image category feature distribution, and construct a perturbation parameter according to the known image category feature distribution; a data processing module configured to process the training data according to the disturbance parameter using the unknown feature processing unit to obtain an unknown image category feature distribution; a training model module configured to train the image classifier based on the known image category feature distribution and the unknown image category feature distribution, and adjust the parameters of the feature processing network using the trained image classifier to obtain a target image classification model; The parameter sending module is configured to send the model parameters corresponding to the target image classification model to the terminal side device.
14. A computing device comprising: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method according to any one of claims 1 to 10 are implemented.
15. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 10.
16. A computer program product comprising a computer program or instructions, which implement the steps of the method according to any one of claims 1 to 10 when executed by a processor.