Sample acceleration reduction method and device, medium, equipment and program
By updating the target dimension set in the particle swarm optimization algorithm, the parameters dependence and time-consuming problems in the sample specification method based on the evolutionary algorithm are solved, and the accelerated specification and efficiency improvement of the sample is achieved.
Patent Information
- Application Number
- CN202411183092.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-17
AI Technical Summary
The existing sample specification methods based on evolutionary algorithms rely on too many parameters, resulting in unstable performance, difficult application, low search efficiency and time-consuming problems.
By obtaining the current optimal position of each particle during the iteration of the particle swarm optimization algorithm, determining the dimension information, and updating the target dimension set based on this information, gradually reducing the dimension during iteration, so as to improve search efficiency and reduce time-consuming.
Accelerated specifications for samples are realized, search efficiency is improved, and the specification time is reduced, and the parameters dependence and time-consuming problems in existing methods are solved.
Smart Images

Figure CN119151010A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of training sample specification, and specifically relates to a sample acceleration specification method, device, medium, equipment and program. Background Art
[0002] Sample reduction (also known as sample reduction or sample selection) methods[6] are an outstanding data preprocessing paradigm in statistical machine learning. They can remove redundant samples and noise from a labeled training set to form a reduced subset. Then, sample reduction methods can use the reduced subset to improve the computational efficiency and prediction accuracy of classification statistical algorithms.
[0003] After decades of research, scholars have proposed a large number of sample reduction methods. In addition, some review studies roughly divide the existing sample reduction methods into traditional sample reduction methods and sample reduction methods based on evolutionary algorithms. The existing sample reduction methods based on evolutionary algorithms rely on too many parameters, resulting in unstable performance and difficulty in application. In addition, there are problems such as low search efficiency and long time consumption. Summary of the invention
[0004] In view of the above technical problems, the present invention proposes a method, device, medium, equipment and program for accelerating the reduction of samples. The present application provides a method for accelerating the reduction of samples, including: obtaining the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm. Determine the dimension information of each particle according to the current optimal position of each particle. Determine the target dimension set of the sample in the next iteration according to the dimension information of each particle, and execute the next iteration according to the target dimension set. Accelerated reduction of samples is achieved, search efficiency is improved, and reduction time consumption is reduced.
[0005] To solve the above technical problems, the technical solution provided by the present invention includes five aspects.
[0006] In a first aspect, the present application provides a method for accelerating reduction of samples, comprising: obtaining the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm. Determine the dimension information of each particle according to the current optimal position of each particle. Determine the target dimension set of the sample in the next iteration according to the dimension information of each particle, and execute the next iteration according to the target dimension set.
[0007] In some embodiments, determining the target dimension set of the sample at the next iteration according to the dimension information of each particle includes: determining the number of particle distributions in each dimension according to the dimension information of each particle. Determining the target dimension set of the sample at the next iteration according to the number of particle distributions.
[0008] In some embodiments, determining the target dimension set of the sample at the next iteration according to the particle distribution quantity includes: obtaining the target dimension whose particle distribution quantity is 0 from the current dimension set of the current iteration. Deleting the target dimension from the current dimension set to obtain the target dimension set of the sample at the next iteration.
[0009] In some embodiments, determining the target dimension set of the sample in the next iteration based on the particle distribution number also includes: obtaining the target dimension in which the particle distribution number is the particle group number from the current dimension set of the current iteration; deleting the target dimension from the current dimension set to obtain the target dimension set of the sample in the next iteration; and determining the sample corresponding to the target dimension as a subset sample of the reduced subset.
[0010] In some embodiments, the method further includes: obtaining a maximum number of iterations and the current number of iterations. When the current number of iterations is greater than or equal to the maximum number of iterations, stopping iteration, outputting an optimal position of the optimal particle in the particle swarm, and determining a subset sample of the reduced subset according to the optimal position.
[0011] In some embodiments, the step of obtaining the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm includes: obtaining the target dimension set, the current optimal position of each particle, and the fitness value determined in the previous iteration of each sample. The current optimal position of each particle in the current iteration is determined based on the target dimension set, the current optimal position of each particle, and the fitness value.
[0012] In the second aspect, the present application proposes an accelerated reduction device for samples, comprising: a first acquisition module, used to obtain the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm. A first determination module, used to determine the dimension information of each particle according to the current optimal position of each particle. A first execution module, used to determine the target dimension set of the sample at the next iteration according to the dimension information of each particle, and execute the next iteration according to the target dimension set.
[0013] In a third aspect, the present application proposes a computer device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any one of the methods described in the first aspect.
[0014] In a fourth aspect, the present application proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0015] In a fifth aspect, the present application proposes a computer program product, comprising a computer program / instructions, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0016] Beneficial effects created by the present invention: The present application adopts a method for accelerating reduction of samples, including: obtaining the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm. Determine the dimension information of each particle according to the current optimal position of each particle. Determine the target dimension set of the sample in the next iteration according to the dimension information of each particle, and execute the next iteration according to the target dimension set. Accelerated reduction of samples is achieved, search efficiency is improved, and reduction time consumption is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The scope of the present disclosure may be better understood by reading the following detailed description of exemplary embodiments in conjunction with the accompanying drawings. The drawings included are:
[0018] Figure 1 An overall flow chart of a sample acceleration reduction method provided in an embodiment of the present application;
[0019] Figure 2 A detailed flow chart of a sample acceleration reduction method provided in an embodiment of the present application;
[0020] Figure 3 A structural block diagram of a sample acceleration protocol device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0022] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0023] If similar descriptions of "first\second\third" appear in the application documents, the following instructions will be added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0025] Embodiment 1:
[0026] After decades of research, scholars have proposed a large number of sample reduction methods. In addition, some review studies roughly divide the existing sample reduction methods into traditional sample reduction methods and sample reduction methods based on evolutionary algorithms. The existing sample reduction methods based on evolutionary algorithms rely on too many parameters, resulting in unstable performance and difficulty in application. In addition, there are problems such as low search efficiency and long time consumption.
[0027] In view of the problems existing in the prior art, such as Figure 1 As shown, the present application provides a sample acceleration protocol method, which is applied to an electronic device, and the electronic device can be a server, a mobile terminal, a computer, a cloud platform, etc. The function implemented by the device data processing provided in the embodiment of the present application can be implemented by calling a program code by a processor of the electronic device, wherein the program code can be stored in a computer storage medium, and the sample acceleration protocol method includes:
[0028] Step S1: Obtain the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm.
[0029] In some embodiments, step S1 of "obtaining the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm" includes:
[0030] Step S11: Obtain the target dimension set determined by the last iteration of each sample, the current optimal position and fitness value of each particle.
[0031] Step S12: determining the current optimal position of each particle in the current iteration according to the target dimension set, the current optimal position of each particle and the fitness value.
[0032] Because the particle swarm optimization algorithm is an iterative process, the optimal position of each particle under the current number of iterations will be generated in each iteration. However, the general particle swarm optimization algorithm can only determine whether each sample is a subset sample of the specification subset after the iteration is completed. In order to solve this technical problem, the target dimension set for the next iteration execution will be updated in each iteration process in this application, so that the calculation during the iteration is gradually reduced with the number of iterations, thereby improving the search efficiency and reducing the time consumption.
[0033] Step S2: Determine the dimensional information of each particle according to the current optimal position of each particle.
[0034] In each iteration, the position information of each particle is designed, and this position information can express the current dimension information of each particle. Therefore, the dimension information of each particle can be determined according to the current optimal position of each particle.
[0035] Step S3: Determine the target dimension set of the sample in the next iteration according to the dimension information of each particle, and execute the next iteration according to the target dimension set.
[0036] In some embodiments, step S3 "determining a target dimension set of the sample in the next iteration according to the dimension information of each particle" includes:
[0037] Step S31: Determine the number of particle distributions in each dimension according to the dimensional information of each particle.
[0038] Step S32: Determine the target dimension set of the sample in the next iteration according to the number of particle distributions.
[0039] In some embodiments, step S32 of “determining a target dimension set of the sample in the next iteration according to the number of particle distributions” includes:
[0040] Step S321: Obtain the target dimension in which the particle distribution quantity is 0 from the current dimension set of the current iteration.
[0041] Step S322: Delete the target dimension from the current dimension set to obtain the target dimension set of the sample in the next iteration.
[0042] In some embodiments, the step S32 of “determining a target dimension set of the sample in the next iteration according to the number of particle distributions” further includes:
[0043] Step S323: obtaining the target dimension in which the particle distribution quantity is the particle group quantity from the current dimension set of the current iteration.
[0044] Step S324: Delete the target dimension from the current dimension set to obtain the target dimension set of the sample in the next iteration.
[0045] Step S325: and determine the samples corresponding to the target dimension as the subset samples of the reduced subset.
[0046] This application is a sample accelerated reduction method based on accelerated backbone particle swarm (SRM-HBPSO). In SRM-HBPSO, this paper first designs an accelerated backbone binary particle swarm optimization algorithm (HBPSO) combined with a search space reduction strategy. Then, SRM-HBPSO uses HBPSO to optimize the labeled training set. During the optimization process, a search space reduction strategy is added to obtain an optimized reduced subset. The acceleration of sample reduction is achieved.
[0047] set up is a particle swarm with N particles in the g(g=0,...,G)th iteration. Each particle There is a position vector and the position indicator vector Where M is the dimension of the search space. When iteration g = 0, use formula (1) to initialize each particle Location
[0048]
[0049] In formula (1), rand() is a function that returns a random value between 0 and 1. Formula 1 can be used to initialize particles. Location
[0050] During the evolution process, if the best position of each particle If no specific dimension d (d = 1, ..., M) in the search space is selected, then at the end of the iteration (g = G), the position of the best particle in the particle swarm is gbest g Most likely, dimension d was not chosen.
[0051] Based on the above assumptions, HBPSO can decide the dimensions to be selected or deleted during the evolution process (rather than at the end of the iteration), which speeds up the search efficiency and reduces the time cost. To control the dimensions that are selected and deleted, and use formula (7) to update
[0052] In formula (2), for The corresponding particle position indicator. If all The corresponding particle position indicator is 0 (that is, all No dimension d) or all selected The corresponding particle position indicator is 1 (i.e. all Choose dimension d), then Dimension d will not be included and will not evolve (i.e. HBPSO will not be updated and As shown in formula (3)-formula (4),
[0053]
[0054]
[0055] When all particles have selected dimension d, it can be said that the dimension is one of the best subsets, so the dimension does not need to be updated anymore, and the sample can be determined as a subset sample in advance, that is, the content described in step S323 to step S235. g Particle g The position of the best particle in the gth (g=1,...,G)th iteration, for gbest g The corresponding particle position indicator vector, For particles Indicator vector of the particle position at the gth (g=1,...,G)th iteration.
[0056] In each iteration, Figure 2 As shown, the main steps of this application include:
[0057] Step S101: Obtain a labeled training set and set parameters N and G, where parameter N represents the number of particles in the particle swarm and G represents the maximum number of iterations.
[0058] Step S102: Initialize or update the position of each particle.
[0059] Step S103: Update the indicator of each particle according to the position of each particle.
[0060] Step S104: Evaluate the fitness value of each particle at the current position.
[0061] Step S105: Determine the current optimal position of each particle according to the fitness value.
[0062] Step S106: Determine the target dimension set for the next iteration based on the current optimal position.
[0063] Step S107: Execute step S102 according to the target dimension set.
[0064] In step S101 to step S107, the position of each particle is initialized by equation 1, and the position of each particle is updated by equation 3, and step S103 is executed to update the indicator of each particle by equation 4. Step S106 is executed according to equation 2.
[0065] Then use formula (5) to calculate each particle The fitness value of That is, step S104 is executed through equation 5.
[0066]
[0067] In formula (5), is the classification accuracy of a given classification model C (in this paper, C is set as a random forest classification model). Classification model C is trained on and evaluates on X, where By decoding To obtain a subset of labeled samples from X, that is Storage rate / |X|. The parameter γ is used to weigh and
[0068] Wherein, step S105 “determining the current optimal position of each particle according to the fitness value” is performed by the following formula:
[0069] When the statistics find that if the maximum fitness value of the particle at the current position is greater than the maximum fitness value at the previous iteration, the current optimal position of the particle is updated by the following formula, and the optimal position and indicator of the particle swarm are determined.
[0070]
[0071] In some embodiments, the method further comprises:
[0072] Step S4: Obtain the maximum number of iterations and the current number of iterations.
[0073] Step S5: When the current number of iterations is greater than or equal to the maximum number of iterations, the iteration is stopped, and the optimal position of the optimal particle in the particle swarm is output.
[0074] Step S6: Determine the subset samples of the reduced subset according to the optimal position.
[0075] This application gradually reduces the dimensions of the target dimension concentration during the iteration process, so that the time consumption of each iteration is gradually reduced, and the computing pressure of the computing device is gradually reduced, thereby better improving the computing efficiency, increasing the search speed, and realizing the accelerated specification of the target sample data.
[0076] Compared with the existing sample reduction methods based on evolutionary algorithms, SRM-HBPSO has the following advantages: it reduces the time consumption in setting parameters and the time consumption of each iteration. Then, by reducing the search space, it reduces the time consumption in terms of calculation and improves the search speed. It realizes the accelerated reduction of target sample data.
[0077] Embodiment 2:
[0078] Based on the foregoing embodiments, the embodiments of the present application provide a sample acceleration protocol device, and the modules included in the device, as well as the units included in each module, can be implemented by a processor in a computer device; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Microprocessor Unit), a digital signal processor (DSP, Digital Signal Processing) or a field programmable gate array (FPGA, Field Programmable Gate Array), etc.
[0079] like Figure 3 As shown, a sample acceleration protocol device provided in the present application includes: a first acquisition module 1, a first determination module 2 and a first execution module 3.
[0080] The first acquisition module 1 is used to obtain the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm. The first determination module 2 is used to determine the dimension information of each particle according to the current optimal position of each particle. The first execution module 3 is used to determine the target dimension set of the sample in the next iteration according to the dimension information of each particle, and execute the next iteration according to the target dimension set.
[0081] Each module in the acceleration protocol device of the above-mentioned sample can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the device in the form of hardware, or can be stored in the memory in the processing device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0082] Embodiment 3:
[0083] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any one of the methods described in the first aspect.
[0084] Embodiment 4:
[0085] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0086] Embodiment 5:
[0087] In a fifth aspect, the present application provides a computer program product, comprising a computer program / instructions, characterized in that when the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0088] Those of ordinary skill 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 at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0089] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and 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 embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0090] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0091] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0092] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units. They may be located in one place or distributed over 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] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit. The above integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0094] Those skilled in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium, and when the program is executed, the steps of the above method embodiments are executed. The above storage medium includes: a mobile storage device, a read-only memory (ROM), a magnetic disk or an optical disk, and other media that can store program codes.
[0095] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a controller to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0096] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for accelerating sample reduction, characterized in that: include: Obtain the current optimal position of each particle in the current iteration of the particle swarm optimization algorithm for each sample in the target sample data set; Determining dimensional information of each particle according to the current optimal position of each particle; A target dimension set of the sample in the next iteration is determined according to the dimension information of each particle, and the next iteration is performed according to the target dimension set.
2. The method according to claim 1, characterized in that The step of determining a target dimension set of the sample in the next iteration according to the dimension information of each particle includes: Determine the number of particles distributed in each dimension according to the dimensional information of each particle; A target dimension set of the sample in the next iteration is determined according to the number of particle distributions.
3. The method according to claim 2, characterized in that The step of determining a target dimension set of the sample at the next iteration according to the number of particle distributions includes: Obtain a target dimension in which the number of particle distribution is 0 from the current dimension set of the current iteration; The target dimension is deleted from the current dimension set to obtain a target dimension set for the sample in the next iteration.
4. The method according to claim 3, characterized in that Determining the target dimension set of the sample at the next iteration according to the number of particle distributions also includes: Obtaining a target dimension in which the number of particles distributed is the number of particle groups from the current dimension set of the current iteration; Deleting the target dimension from the current dimension set to obtain a target dimension set for the sample in the next iteration; And the samples corresponding to the target dimension are determined as subset samples of the reduced subset.
5. The method according to claim 1, characterized in that The method further comprises: Obtaining the maximum number of iterations and the current number of iterations; When the current number of iterations is greater than or equal to the maximum number of iterations, the iteration is stopped, and the optimal position of the optimal particle in the particle swarm is output; Subset samples of the reduced subset are determined according to the optimal position.
6. The method according to claim 1, characterized in that The step of obtaining the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm includes: Obtain the target dimension set determined by each sample in the previous iteration, the current optimal position and fitness value of each particle; The current optimal position of each particle in the current iteration is determined according to the target dimension set, the current optimal position of each particle and the fitness value.
7. A sample acceleration protocol device, characterized in that: include: The first acquisition module is used to obtain the current optimal position of each particle of each sample in the target sample data set in the current iteration of the particle swarm optimization algorithm; A first determination module, configured to determine the dimension information of each particle according to the current optimal position of each particle; The first execution module is used to determine a target dimension set of the sample in the next iteration according to the dimension information of each particle, and execute the next iteration according to the target dimension set.
8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
