Junk image classification method and device, computer equipment and storage medium

By performing transfer learning in the garbage image classification task, using the model parameters of the unlabeled data set and the labeled data set, the problem of poor stability in different scenarios in the existing technology is solved, and a high-precision garbage classification effect is achieved.

CN119579956APending Publication Date: 2025-03-07UNIV OF SHANGHAI FOR SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing garbage image classification model is difficult to work stably in different application scenarios, resulting in a decrease in classification accuracy.

Method used

Transfer learning is performed by obtaining the unlabeled junk image dataset in the current task scenario and using the trained source model with the marked junk image dataset. The specific steps include initializing the target model, segmenting the training data set, performing multiple iterative update training of parameter, building a semantic nearest neighbor topology, optimizing model parameters, and finally obtaining a garbage classification model suitable for new scenarios.

Benefits of technology

It realizes that in the garbage classification task in different scenarios, the model can quickly adapt and achieve high accuracy, solving the problem of poor stability of existing models in different application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119579956A_ABST
    Figure CN119579956A_ABST
Patent Text Reader

Abstract

The invention discloses a junk image classification method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining an unmarked to-be-trained junk image data set in a current task scene, and dividing the to-be-trained junk image data set into a plurality of training data sets; obtaining model parameters of a garbage classification source model trained by using the marked garbage image data set; initializing a garbage classification target model with the same network structure according to the model parameters, inputting a plurality of training data sets into the garbage classification target model in sequence, and obtaining a final garbage classification target model after multiple times of parameter iteration updating training; and inputting the to-be-classified garbage images into the final garbage classification target model to obtain a classification result of the to-be-classified garbage images. According to the scheme of the invention, the problem that a trained model is difficult to work stably in different application scenes when an existing junk image classification model classifies junk in different application scenes is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a garbage image classification method, device, computer equipment and storage medium. Background Art

[0002] Garbage disposal has become a very important aspect in modern human life. Garbage classification is an important part of garbage disposal. Reasonable classification can realize resource recycling and save manpower.

[0003] Manual sorting is a commonly used method of garbage classification in the past, but long working hours and high labor intensity are the first problems that sorters have to face. The decline in sorting accuracy caused by long-term manual sorting is also not to be ignored. Image classification is one of the research fields of computer vision. It is based on a certain classification algorithm and determines the category of an image by extracting semantic information from the image. At present, garbage image classification based on computer vision has achieved some results, but the difficulty lies in the collection of data sets. Because the types of garbage in different regions or different places are obviously different, a trained model is difficult to work stably in different application scenarios. Therefore, a model with strong generalization is needed to classify garbage in different application scenarios. Summary of the invention

[0004] The embodiments of the present invention provide a garbage image classification method, apparatus, computer equipment and storage medium to solve the problem that when the existing garbage image classification model classifies garbage in different application scenarios, the trained model is difficult to work stably in different application scenarios.

[0005] A garbage image classification method, comprising:

[0006] Obtain an unlabeled garbage image dataset to be trained in the current task scenario, and divide the unlabeled garbage image dataset to be trained into several training datasets; obtain model parameters of a garbage classification source model trained using the labeled garbage image dataset;

[0007] Initializing a garbage classification target model with the same network structure according to the model parameters, inputting several training data sets into the garbage classification target model in sequence, and obtaining a final garbage classification target model after multiple parameter iterations and training;

[0008] The training process includes:

[0009] The current training data set is divided into two training data sets, one training data set is input into the current garbage classification target model to obtain the pseudo label value of the image in the current training data set; the other training data set is input into another garbage classification target model, and a semantic neighbor topology structure is constructed after performing a similarity semantic search on the images in the input training data set by using a semantic similarity algorithm; the output result of the other garbage classification target model is optimized by the semantic neighbor topology structure to obtain a predicted classification result; the parameters of the current garbage classification target model are optimized according to the predicted classification result and the pseudo label value of the image;

[0010] The garbage image to be classified is input into the final garbage classification target model to obtain the classification result of the garbage image to be classified.

[0011] A garbage image classification device, comprising:

[0012] The acquisition module is used to obtain an unlabeled garbage image dataset to be trained in the current task scenario, and divide the garbage image dataset to be trained into several training datasets; obtain the model parameters of the garbage classification source model trained using the labeled garbage image dataset;

[0013] The first training module is used to initialize a garbage classification target model with the same network structure according to the model parameters, input a plurality of training data sets into the garbage classification target model in sequence, and obtain a final garbage classification target model after multiple parameter iterations and training;

[0014] The second training module is used to divide the current training data set into two training data sets, one training data set is input into the current garbage classification target model to obtain the pseudo label value of the image in the current training data set; the other training data set is input into another garbage classification target model, and by using a semantic similarity algorithm, a similarity semantic search is performed on the images in the input training data set, and a semantic neighbor topological structure is constructed; the output result of the other garbage classification target model is optimized by the semantic neighbor topological structure to obtain a predicted classification result; the parameters of the current garbage classification target model are optimized according to the predicted classification result and the pseudo label value of the image;

[0015] The classification module inputs the garbage image to be classified into the final garbage classification target model to obtain the classification result of the garbage image to be classified.

[0016] A computer device comprises a memory and a processor, wherein the memory stores computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory to implement the above-mentioned garbage image classification method.

[0017] A computer-readable storage medium, the computer-readable storage medium is used to store computer-executable instructions, the computer-executable instructions are used to implement the above-mentioned garbage image classification method when executed by a processor

[0018] The present invention provides a garbage image classification method, device, computer equipment and storage medium, which have the following beneficial effects:

[0019] The scheme of the present invention obtains an unlabeled garbage image data set to be trained in the current task scenario, and divides the garbage image data set to be trained into several training data sets; obtains model parameters of a garbage classification source model trained using the labeled garbage image data set; initializes a garbage classification target model with the same network structure according to the model parameters, inputs several training data sets into the garbage classification target model in sequence, and obtains a final garbage classification target model after multiple parameter iterative update training; inputs the garbage image to be classified into the final garbage classification target model to obtain a classification result of the garbage image to be classified.

[0020] First, a garbage classification source model is obtained, and then migration is performed to the final garbage classification target model based on the garbage classification source model. Among them, the scheme of the present invention is a process of adaptive classification from a source domain containing rich label information to a target domain without label information. The model proposed in the present invention can use the geometric structure information of the data distribution in the target task to train the model on unlabeled image sets in different scenarios when there is only one trained garbage classification model, so that the model can quickly adapt to the garbage classification tasks in new scenarios and achieve higher accuracy. Therefore, the present invention solves the problem that when the existing garbage image classification model is used to classify garbage in different application scenarios, the trained model is difficult to work stably in different application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0022] Figure 1 is a schematic diagram of the overall deployment of a junk image classification method in one embodiment of the present invention;

[0023] Figure 2 is a flow chart of a method for classifying junk images in one embodiment of the present invention;

[0024] Figure 3 is another flow chart of a method for classifying junk images in one embodiment of the present invention;

[0025] Figure 4 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] In one embodiment, if Figure 1 and Figure 2 As shown, a garbage image classification method is provided, including the following specific contents:

[0028] For the task of garbage classification, due to data privacy protection, it is extremely difficult to collect annotated data sets. The annotation of the corresponding tasks and the training of models from scratch for each task are a huge test for manpower and economy. At the same time, various factors, such as climate factors (rain, snow, fog, etc.), terrain factors (hills, forests, etc.) and background factors (floor texture, pedestrians, etc.), etc., because the data used in training are usually data with obvious features and clean background, various external interferences will cause the performance of the trained model to decline or even fail, and garbage classification in different scenarios is one of them. In order to solve the garbage classification problem in different scenarios under data protection, the model proposed in the present invention can use the geometric structure information of the data distribution in the target task when there is only one trained garbage classification model, and train the model on unlabeled image sets in different scenarios, so that the model can quickly adapt to the garbage classification tasks in new scenarios and achieve higher accuracy.

[0029] This embodiment now provides two garbage classification tasks with the same classification objectives but different and complex scenarios, namely A and B. Task A is a garbage classification model that can be provided by the provider in a clean scenario using rich labeled data. It can have a good garbage classification performance in Task A. Task B is a garbage classification scenario that the demand side needs to deal with. For data protection, only a trained model can be provided for the demand side to use. The model trained on A is difficult to have a good performance in B. In order to save costs and quickly obtain a more robust model to achieve the garbage classification task in Task B, the following training method is used to train the model. The steps are as follows:

[0030] 1) Build a garbage classification and recognition robot model equipped with visual sensors, mobile, host and corresponding storage devices. Manually control the robot to collect and store garbage image data in the scene of task B to form an unlabeled garbage data set.

[0031] 2) The collected data set is put into model A and the above method is used to perform model migration training to obtain model B suitable for the new scenario B.

[0032] 3) The model is compressed by means of parameter quantization, pruning, knowledge distillation, etc., and the compressed model B' is obtained so that the model can be deployed on edge devices such as garbage robots.

[0033] Specifically, the model pre-training for task A includes: first, training the garbage classification model for the garbage data in task A, which is denoted as model A. The deep neural network representation consists of the following three parts: a feature extractor u S (·;θ S ), a bottleneck layer g S (·;φ S ) and a classifier c S (·;ψ S ). Therefore, the source model Expressed as where Θ S ={θ S ,φ S , ψ S} are the parameters of the trained source model. Source model Training is performed by minimizing the following objective:

[0034]

[0035] Where γ is the weight parameter; σ c (·) is the c-th element of the output vector after the softmax operation; is the smoothing label l i,c The cth element of i,c One-Hot label The cth element of .

[0036] Specifically, Task B garbage data collection includes building a garbage classification and recognition robot model equipped with a visual sensor, a mobile host and corresponding storage devices. The robot is manually controlled to collect and store garbage image data in the scene of Task B, forming an unlabeled garbage data set, denoted as X.

[0037] Task B basic model training uses the above-collected data set X and the source model A obtained by the above model to train model B. The model training process is shown in the following figure. Figure 2 shown.

[0038] Here we show the intermediate stages of model B training. The training framework of Modeled as a neural network architecture such as Figure 2 As shown in the bottom branch of k ) feature extractor, a semantic neighbor construction module, and a bottleneck layer for feature compression (g k ) and a classifier for category prediction (c k ). Among these four modules, except for the semantic neighbor construction module which is used to form semantic neighbors for the input instances in the deep space, the rest are network structures.

[0039] As shown in the top branch, there is a pseudo-label assignment module to generate pseudo-labels, which assists in two ways The training of the proposed method can: (1) perform self-supervised training based on pseudo labels; (2) provide guidance for the semantic neighbor topology structure in the semantic neighbor construction module.

[0040] In order to drive the model to perform adaptive training, the following loss function is constructed for model training, and finally the garbage classification model B for task B is obtained.

[0041]

[0042] (1) Using the entropy loss function based on probability prediction as an unsupervised optimization term.

[0043]

[0044] (2) Using a classification loss function based on pseudo labels as a self-supervised optimization term.

[0045]

[0046] The server for training model B is used as a cloud server and is maintained and supervised by professional staff.

[0047] Specifically, for any target data x, its corresponding pseudo label and semantic neighbor topology are and In the model Under the mapping of , after the softmax operation σ(·), x i is converted into a probability vector Similarly, the semantic neighbor topology is converted into a probabilistic form in

[0048] Entropy minimization on the manifold. Entropy minimization is an unsupervised optimization process. In order to achieve semantic consistency, the semantic fusion proposed by the equation is performed. The output of the following formula is used as the semantics of the semantic neighbor topology structure.

[0049]

[0050] Then, based on the above fusion prediction, the entropy minimization operation is performed according to the following equation, where is a vector The c-th element of .

[0051]

[0052] At the same time, in order to avoid class collapse, the following class balance loss is added to force the data distribution to be close to class uniform distribution. That is, the data is distributed over C categories with equal probability.

[0053]

[0054] where KL(·,·) is a function that outputs the Kullback–Leibler (KL) divergence of two input probability vectors. Combining Eq. and Entropy minimization on the manifold is expressed as:

[0055]

[0056] Self-supervised regularization on manifolds. Softmax cross entropy loss (SCE) is a widely used regularization method for classification tasks in a supervised learning manner. The following SCE loss function with pseudo labels is used to overcome the random factors caused by unsupervised terms.

[0057]

[0058] in, In a supervised manner, the semantic prediction of the semantic neighbor topology is used as the supervision of the SCE loss to further enhance the semantic consistency of the semantic neighbor topology. This regularization formula is formulated as the following equation:

[0059]

[0060] in,

[0061] Combining equations and The self-supervised regularization on the manifold is proposed by the following equation, where α, β are trade-off parameters.

[0062]

[0063] Therefore, the semantic consistency objective of the k-th stage training of the target model can be summarized as the following loss function.

[0064]

[0065] In order to drive the model to perform adaptive training, the following loss function is constructed for model training, and finally the garbage classification model B for task B is obtained.

[0066] In order to enable the model to be deployed on the garbage robot, the model needs to be simplified and the results of the garbage data in task B predicted by model B obtained in step 2 are used as the true label y for training. The network layer is divided into multiple stages so that feature maps of the same size (i.e. spatial resolution) belong to the same stage, and the feature map size is reduced by half in each subsequent stage. Let z i In the i-th stage, we denote the output feature map of the teacher model, represents the output feature map of the student model at stage i. i and The l2 loss between is used to supervise the feature learning process. In addition, knowledge distillation is used to take the output probability of the teacher model (model B) as the soft label. Therefore, the final loss of the training single model is defined as follows:

[0067]

[0068] where x and y represent the input and output provided by the dataset, respectively; w represents the learnable parameters of the student model; p(·) and q(·) are the output probabilities of the teacher model and the student model, respectively; lCE is the cross entropy loss.

[0069] Deployment of the overall environment: There is a cloud server, on which a large classification model B is deployed to complete the training of task B; a garbage classification recognition robot, on which a visual sensor is deployed to collect garbage image data; a host, on which a lightweight model B' is deployed to provide real-time garbage classification results, and a garbage classification dictionary is also loaded. The lid point has two attribute values, namely, garbage attributes (dry garbage, wet garbage, and recyclable garbage) and picking attributes (grasping, shoveling, and sucking), and judgment is made based on the classification results. The memory is used to provide storage functions for collected data, and the network module is used to communicate data with the cloud server; a grabbing mechanical arm is loaded at the bottom of the robot, and a dust suction device and a shovel device are used to process garbage.

[0070] For the outdoor scene mode, the robot moves outdoors and uses the visual sensor to scan the scene. When it patrols the garbage, it collects images and saves the data locally while sending it to the local lightweight model B'. The model gives a classification result and matches the classification result with the locally maintained garbage classification dictionary. Based on the matching result, it decides which picking method to use and which garbage storage box (dry and wet recyclable) to send the garbage to.

[0071] After the outdoor picking work is completed, the robot returns to the charging area. At this time, the robot connects to the internal network and uploads the collected data to the cloud server. Staff then conduct further iterative training and model compression of model B based on such data, and update the local compressed model B' on the robot to achieve model optimization.

[0072] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0073] In one embodiment, a junk image classification device is provided, which corresponds to the junk image classification method in the above embodiment. The junk image classification device includes an acquisition module, a first training module, a second training module and a classification module. Each functional module is described in detail as follows:

[0074] The acquisition module is used to obtain an unlabeled garbage image dataset to be trained in the current task scenario, and divide the garbage image dataset to be trained into several training datasets; obtain the model parameters of the garbage classification source model trained using the labeled garbage image dataset;

[0075] The first training module is used to initialize a garbage classification target model with the same network structure according to the model parameters, input a plurality of training data sets into the garbage classification target model in sequence, and obtain a final garbage classification target model after multiple parameter iterations and training;

[0076] The second training module is used to divide the current training data set into two training data sets, one training data set is input into the current garbage classification target model to obtain the pseudo label value of the image in the current training data set; the other training data set is input into another garbage classification target model, and by using a semantic similarity algorithm, a similarity semantic search is performed on the images in the input training data set, and a semantic neighbor topological structure is constructed; the output result of the other garbage classification target model is optimized by the semantic neighbor topological structure to obtain a predicted classification result; the parameters of the current garbage classification target model are optimized according to the predicted classification result and the pseudo label value of the image;

[0077] The classification module inputs the garbage image to be classified into the final garbage classification target model to obtain the classification result of the garbage image to be classified.

[0078] The specific definition of the garbage image classification device can be found in the definition of the garbage image classification method above, which will not be repeated here. Each module in the above-mentioned garbage image classification device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0079] In one embodiment, Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention. Figure 4 As shown, the computer device of this embodiment includes: at least one processor ( Figure 4 Only one is shown in the figure), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps in any of the above-mentioned garbage image classification method embodiments are implemented.

[0080] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that Figure 4 This is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input device.

[0081] The processor may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0082] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory may be the memory of a computer device, and the internal memory provides an environment for the operation of an operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments may also be an external storage device of a computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on a computer device. Further, the memory may also include both an internal storage unit of a computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs, etc. The memory may also be used to temporarily store data that has been output or is to be output.

[0083] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiment can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0084] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiment when executing.

[0085] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0086] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the junk image classification method in the above embodiment is implemented. To avoid repetition, it is not described here.

[0087] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0088] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiment when executing.

[0089] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0090] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0091] In the embodiments provided by the present invention, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0092] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0093] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A garbage image classification method, characterized in that: include: Obtain an unlabeled garbage image dataset to be trained in the current task scenario, and divide the garbage image dataset to be trained into several training datasets; Get the model parameters of the garbage classification source model trained using the labeled garbage image dataset; Initializing a garbage classification target model with the same network structure according to the model parameters, inputting several training data sets into the garbage classification target model in sequence, and obtaining a final garbage classification target model after multiple parameter iterations and training; The training process includes: The current training data set is divided into two training data sets, one training data set is input into the current garbage classification target model to obtain the pseudo label value of the image in the current training data set; the other training data set is input into another garbage classification target model, and a semantic neighbor topology structure is constructed after performing a similarity semantic search on the images in the input training data set by using a semantic similarity algorithm; the output result of the other garbage classification target model is optimized by the semantic neighbor topology structure to obtain a predicted classification result; the parameters of the current garbage classification target model are optimized according to the predicted classification result and the pseudo label value of the image; The garbage image to be classified is input into the final garbage classification target model to obtain the classification result of the garbage image to be classified.

2. The garbage image classification method according to claim 1, characterized in that: The garbage classification target model includes: a feature extractor for image feature extraction, a bottleneck layer for feature compression and a classifier for category prediction. The current training data set is input into the feature extractor to obtain a feature image, the feature image is compressed through the feature of the bottleneck layer to obtain a compressed feature image, and the compressed feature image is input into the classifier to obtain the output result of the garbage classification target model.

3. The garbage image classification method according to claim 2, characterized in that: The constructing of the semantic neighbor topology structure includes: Obtain a feature image output by the feature extractor; The semantic neighbor topology structure is constructed by using a semantic similarity algorithm to perform a similarity semantic search on the feature image.

4. The garbage image classification method according to claim 1, characterized in that: Before optimizing the output result of the other garbage classification target model by the semantic neighbor topology structure, the semantic neighbor topology structure is optimized using the pseudo label value, and the output result of the other garbage classification target model is optimized by the optimized semantic neighbor topology structure.

5. The garbage image classification method according to claim 1, characterized in that: The step of optimizing the parameters of the current garbage classification target model according to the predicted classification result and the pseudo label value of the image comprises: A semantic consistency loss function is constructed according to the predicted classification result and the pseudo-label value of the image, and the parameters of the current garbage classification target model are optimized by minimizing the semantic consistency loss function.

6. The garbage image classification method according to claim 5, characterized in that: The specific steps of optimizing the parameters of the current garbage classification target model by minimizing the semantic consistency loss function include: When the semantic consistency loss function decreases, updating the parameters of the current garbage classification target model to the optimal parameters; When the semantic consistency loss function does not decrease, the parameters of the current garbage classification target model are not updated.

7. A garbage image classification device, characterized in that: include: An acquisition module is used to acquire an unlabeled garbage image dataset to be trained in the current task scene, and divide the garbage image dataset to be trained into several training datasets; Get the model parameters of the garbage classification source model trained using the labeled garbage image dataset; The first training module is used to initialize a garbage classification target model with the same network structure according to the model parameters, input a plurality of training data sets into the garbage classification target model in sequence, and obtain a final garbage classification target model after multiple parameter iterations and training; The second training module is used to divide the current training data set into two training data sets, and one training data set is input into the current garbage classification target model to obtain pseudo label values ​​of images in the current training data set; Another set of training data is input into another garbage classification target model. After performing similarity semantic search on the images in the input training data set by using a semantic similarity algorithm, a semantic neighbor topology structure is constructed. The output result of the other garbage classification target model is optimized by using the semantic neighbor topology structure to obtain a predicted classification result. Optimizing the parameters of the current garbage classification target model according to the predicted classification result and the pseudo label value of the image; The classification module inputs the garbage image to be classified into the final garbage classification target model to obtain the classification result of the garbage image to be classified.

8. A computer device comprising a memory and a processor, characterized in that: The memory stores computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory to implement a junk image classification method as claimed in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement a garbage image classification method as described in any one of claims 1 to 6.