Attribute recognition model training method, system, medium, and device
By generating and recognizing images with varying degrees of noise in the attribute recognition model, obtaining effective labels, and training the model, the problem of accuracy loss caused by sharing labels between clear and noisy data is solved, thus improving the model's recognition accuracy and generalization ability.
Patent Information
- Application Number
- CN202310152682.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-02-21
AI Technical Summary
In existing technologies, the sharing of labels between clear data and fused noisy data leads to a loss of the upper limit of recognition accuracy and insufficient generalization ability in attribute recognition models.
By acquiring a clear image of the target and labeling its attributes, a clear data attribute recognition model is trained. Then, different levels of noise are added to generate a fused noise image. The trained model is used to identify and obtain effective attribute labels. Finally, the attribute recognition model is further trained based on these labels.
It improves the accuracy of the attribute recognition model, enhances the generalization ability of the recognition network, and has a lightweight model structure with strong applicability.
Smart Images

Figure CN116152603B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of computer vision technology in artificial intelligence application, and relates to a training method, in particular to an attribute recognition model training method, system, medium and device. BACKGROUND
[0002] Attribute recognition of a target is one of the important tasks in the field of computer vision and artificial intelligence application. The technology has been widely applied in security, monitoring, and people and vehicle flow analysis scenes. Diffusion model is mainly applied to generation model, such as image generation, text generation, speech generation and waveform signal generation, and has achieved excellent performance.
[0003] Attribute recognition mainly recognizes the basic attributes of a target, such as the gender, age, clothing color and accessories of a pedestrian, and the color, brand and series of a car. The common method uses a deep learning network to recognize, and before network learning, image enhancement methods such as left-right flipping, picture translation, scaling, random erasing, clipping and noise blurring are used to expand the number of images. The method of adding noise blurring will lose the visual information of the image itself.
[0004] In the training of the model, the original data label is used for the data with weak or lost visual information. The data with lost visual information is difficult to directly reflect the label, which is called fuzzy data. From Figure 1 It can be seen from the figure that when the image resolution is reduced and noise is added, some information in the blurred image cannot be distinguished by the naked eye, such as the shoulder bag, hat and even hairstyle.
[0005] Usually, the model uses clear data and fuzzy data after data enhancement as training samples at the same time, and the fuzzy data and the source data use common labels. This is harmful to the upper limit of the recognition accuracy of the model, because some attributes are difficult to identify when the visual information is lost or insufficient. This training will make the recognition model speculate on the attributes that are difficult to identify for unclear samples, which is the main reason for reducing the upper limit of the model recognition accuracy. However, the method of adding noise by data enhancement is essential and can effectively enhance the generalization ability of the recognition network.
[0006] Therefore, in the existing target attribute recognition technology, the common label of clear data and fuzzy noise data causes the problem of loss of the upper limit of model recognition accuracy, which further leads to the problems of low accuracy of attribute recognition model and insufficient generalization ability of recognition network. SUMMARY
[0007] In view of the above-mentioned disadvantages of the prior art, the purpose of the present application is to provide an attribute recognition model training method, system, medium and device, which is used to solve the problem that the upper limit of the model recognition accuracy is lost due to the fact that clear data and fusion noise data share the same label in the training process of the prior art, thereby causing the problems of low accuracy of the attribute recognition model and insufficient generalization ability of the recognition network.
[0008] To achieve the above-mentioned purpose and other related purposes, in a first aspect, the present application provides an attribute recognition model training method, comprising the following steps: obtaining a target clear image and an attribute label of the target clear image; training a clear data attribute recognition model based on the target clear image and the attribute label; adding noise of different degrees to the target clear image to generate a plurality of fusion noise images; identifying the fusion noise images based on the trained clear data attribute recognition model to obtain effective attribute labels of the fusion noise images; training an attribute recognition model based on the fusion noise images and the corresponding effective attribute labels, so as to perform attribute recognition of images based on the trained attribute recognition model.
[0009] In the present application, a clear image of a target is first collected, and the attributes of the collected clear image of the target are labeled; based on the clear image of the target, an attribute recognition model is constructed by training; at the same time, the target clear image is added with noise of different degrees, so that the target clear image generates a plurality of fusion noise images; at this time, the fusion noise images are input into the trained clear data attribute recognition model as training objects to obtain effective attribute labels of the fusion noise images, thereby completing the attribute recognition process of the images. Through the diffusion training method, the attribute recognition model accuracy can be improved by effectively identifying the recognition part in the attribute label intensive training according to the visual visible information.
[0010] In an implementation manner of the first aspect, training the clear data attribute recognition model based on the target clear image and the attribute label comprises the following steps: inputting the target clear image and the attribute label into the clear data attribute recognition model; adjusting the parameters of the clear data attribute recognition model, so that the clear data attribute recognition model outputs the effective attribute label of the target image.
[0011] In the implementation manner, the target clear image and the attribute label are input into the attribute recognition model for training, and then the parameters of the attribute recognition model are adjusted to finally output the effective attribute label of the target image.
[0012] In an implementation form of the first aspect, the adding different degrees of noise to the target clear image to generate a plurality of fusion noise images comprises the following steps: generating different degrees of noise by using a Gaussian random function; and sequentially fusing the noise with the target clear image in order of increasing noise to obtain the fusion noise images.
[0013] In the present implementation form, different degrees of noise are gradually added to the clear image of the original image to obtain images under different degrees of noise, and the obtained noise images have corresponding attribute labels.
[0014] In an implementation form of the first aspect, the fusion noise image is:
[0015]
[0016] wherein α t = 1-β t = 1-0.001xt; t is a noise coefficient of different degrees; N(0,β t ) is noise; α t is a diffusion coefficient; is a cumulative product of the diffusion coefficient; X0 is the target image; and X t is the fusion noise image.
[0017] In an implementation form of the first aspect, the identifying the fusion noise image based on the trained clear data attribute recognition model to obtain the effective attribute label of the fusion noise image comprises the following steps: obtaining a first attribute clear precision of each attribute of the target clear image based on the trained clear data attribute recognition model; obtaining a second attribute clear precision of each attribute of the fusion noise image based on the trained clear data attribute recognition model; and obtaining the effective attribute label according to the first attribute clear precision and the second attribute clear precision.
[0018] In the present implementation form, the attribute recognition model of the clear image is used to obtain each attribute and attribute clear precision of the clear image, and the clear data attribute recognition model is also used to obtain the attribute clear precision of each attribute of the fusion noise image, and then the effective attribute label is obtained according to different clear precisions, and the invalid attribute label is removed.
[0019] In an implementation form of the first aspect, obtaining the valid attribute label according to the first attribute clarity and the second attribute clarity comprises the following steps: when the second attribute clarity is lower than a product of the first attribute clarity and a preset threshold, the corresponding label is determined as an invalid attribute label; when the second attribute clarity is greater than or equal to the product of the first attribute clarity and the preset threshold, the corresponding label is determined as a valid attribute label.
[0020] In an embodiment of the present application, the preset threshold is:
[0021]
[0022] wherein, t is a noise coefficient of different degrees; is a cumulative product of the diffusion coefficients of the noise in the fusion noise image.
[0023] In the implementation form, the attribute precision calculation formula and the determination condition are further used to determine whether the corresponding label is a valid attribute label. If the corresponding label is a valid attribute label, the label enters the next process; if the corresponding label is an invalid attribute label, the label does not enter the next process for processing.
[0024] In an implementation form of the first aspect, training an attribute recognition model based on the fusion noise image and the corresponding valid attribute label, and performing attribute recognition on an image based on the trained attribute recognition model comprises the following steps: initializing parameters of the attribute recognition model; training the attribute recognition model based on each fusion noise image and the corresponding valid attribute label in order from large to small noise; and training the attribute recognition model based on the target image and the corresponding attribute label again to obtain the trained attribute recognition model.
[0025] In the implementation form, the parameters of the attribute recognition model are initialized, and images with different noise degrees are input into the attribute recognition model for training. Through the retraining process, the accuracy of the attribute recognition model can be improved.
[0026] In a second aspect, the application provides an attribute recognition model training system, comprising: a collection module configured to obtain a target clear image and an attribute label of the target clear image; an identification training module configured to train a clear data attribute recognition model based on the target clear image and the attribute label; a diffusion noise module configured to add different degrees of noise to the target image to generate a plurality of fusion noise images; a label generation module configured to identify the fusion noise images based on the trained clear data attribute recognition model to obtain effective attribute labels of the fusion noise images; and an inverse diffusion training module configured to train an attribute recognition model based on the fusion noise images and the corresponding effective attribute labels to perform attribute recognition of images based on the trained attribute recognition model.
[0027] In the application, the target clear image is obtained by the collection module, and the label is manually labeled. The target clear image obtained is trained based on the identification training module to obtain an attribute recognition model. Meanwhile, the diffusion noise module is used to synthesize fusion noise images with different degrees of noise. The fusion noise images are identified based on the label generation module to determine the effective attribute labels. Finally, the effective attribute labels are trained by the inverse diffusion training module to realize attribute recognition of images. This method improves the recognition accuracy of images.
[0028] In a third aspect, the application provides an attribute recognition model training device, comprising: a processor and a memory. The memory is configured to store a computer program, and the processor is connected to the memory and configured to execute the computer program stored in the memory to enable the attribute recognition model training device to perform the attribute recognition model training method.
[0029] As described above, the attribute recognition model training method, system, medium and device of the application have the following beneficial effects:
[0030] (1) The training method based on the diffusion model avoids the speculation part of the network in the training process, and can effectively identify the recognizable part in the attribute label intensive training according to the visual visible information; thereby avoiding the problem of upper limit loss of model recognition accuracy caused by the fusion noise data and the clear data sharing the same label in the training process, and improving and enhancing the attribute recognition model accuracy.
[0031] (2) The attribute recognition model training method of the application can effectively improve the generalization ability of the recognition network.
[0032] (3) The attribute recognition model training method of the application adopts a lightweight model structure, which has low requirements for devices and is highly applicable. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1An implementation schematic diagram of the attribute recognition model training method of the present application in an application scenario is shown.
[0034] Figure 2 A flowchart of the attribute recognition model training method of the present application in an embodiment is shown.
[0035] Figure 3 A flowchart of S12 in the attribute recognition model training method of the present application is shown.
[0036] Figure 4A A flowchart of S13 in the attribute recognition model training method of the present application is shown.
[0037] Figure 4B A process of gradually adding noise to a pedestrian original image and an original image attribute label indication diagram in an embodiment of the attribute recognition model training method of the present application are shown.
[0038] Figure 4C A process of gradually adding noise to a vehicle original image and an original image attribute label indication diagram in an embodiment of the attribute recognition model training method of the present application are shown.
[0039] Figure 5 A flowchart of S14 in the attribute recognition model training method of the present application is shown.
[0040] Figure 6 An effective attribute label recognition flowchart in an embodiment of the attribute recognition model training method of the present application is shown.
[0041] Figure 7 A flowchart of S15 in the attribute recognition model training method of the present application is shown.
[0042] Figure 8 A principle structure schematic diagram of the attribute recognition model training system of the present application in an embodiment is shown.
[0043] Figure 9 A principle structure schematic diagram of the attribute recognition model training device of the present application in an embodiment is shown.
[0044] Element number explanation
[0045] 81 Acquisition module
[0046] 82 Recognition training module
[0047] 83 Diffusion noise module
[0048] 84 Label generation module
[0049] 85 Reverse diffusion training module
[0050] 91 processor
[0051] 92 memory
[0052] S11-S15 steps DETAILED DESCRIPTION
[0053] The present application is described in greater detail by way of specific embodiments as follows. Other advantages and effects of the present application will be readily appreciated by those skilled in the art from the following description with reference had to the accompanying drawings. The present application can be carried out or applied in other different embodiments, and various modifications or changes can be made to the details of the present application without departing from the spirit of the present application based on different viewpoints and applications. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0054] It should be noted that the drawings provided in the following embodiments only schematically illustrate the basic concept of the present application, and only the components related to the present application are shown in the drawings, not the number, shape and size of the components when actually implemented. The shapes, numbers and proportions of the components when actually implemented can be arbitrarily changed, and the layout pattern of the components can be more complex.
[0055] The attribute recognition model training method provided in the embodiments of the present application will be described in detail below with reference to the accompanying drawings of the embodiments of the present application.
[0056] Please refer to Figure 1 and Figure 2 , respectively showing the implementation schematic diagram of the attribute recognition model training method of the present application in the application scenario and showing the flow schematic diagram of the attribute recognition model training method of the present application in an embodiment. As shown in Figure 1 and Figure 2 , the present embodiment provides an attribute recognition model training method.
[0057] The attribute recognition model training method specifically includes the following steps:
[0058] S11, obtaining a target clear image and an attribute label of the target clear image.
[0059] Please continue to refer to Figure 2 In the present embodiment, a still camera is used to capture the target region, thereby obtaining a captured image in the target region. The captured image is a clear image of the captured target. The target clear image type is a commonly used image type, such as: RGB, RGBD, grayscale image, thermal image, etc.
[0060] After obtaining the target clear image, a manual method is used to mark the corresponding label on the target clear image. For example, the labels in the pedestrian image are: gender, age, clothing, and other attributes; the vehicle image attributes are: vehicle type, brand, license plate number, color, vehicle series, and other attributes.
[0061] S12, training a clear data attribute recognition model based on the target clear image and the attribute label.
[0062] Referring to Figure 3 , a flowchart of S12 in the attribute recognition model training method of the present application is shown. As Figure 3 shown, the S12 includes the following steps:
[0063] S121, inputting the target clear image and the attribute label into the clear data attribute recognition model.
[0064] In this embodiment, according to user requirements, a recognition training network model is constructed.
[0065] Specifically, first, a training data set and a test data set are obtained. The training data set includes a target clear image and an attribute label of the target clear image. Then, the target clear image and the attribute label of the target clear image are input into the recognition network model for training. Through continuous training, the recognition network model is updated according to the recognition result, and finally a clear data attribute recognition model with updated labels is obtained.
[0066] S122, adjusting the parameters of the clear data attribute recognition model to enable the clear data attribute recognition model to output the effective attribute label of the target image.
[0067] In this embodiment, by adjusting the parameters of the high-speed clear data attribute model, the effective attribute label of the target image is finally obtained through the clear data attribute recognition model.
[0068] S13, adding different degrees of noise to the target clear image to generate a plurality of fusion noise images.
[0069] Referring to Figure 4A , a flowchart of S13 in the attribute recognition model training method of the present application is shown. As Figure 4A shown, the S13 includes the following steps:
[0070] S131, generating different degrees of noise using a Gaussian random function.
[0071] In this embodiment, different degrees of noise N(0, β t). Wherein, the value of different degrees of noise is different noise degree coefficient, the greater the noise degree coefficient, the greater the noise. The value range of noise coefficient is: 0-100. The preferred noise coefficient in this embodiment is 5, 10, 20, 40, 100 and other different values.
[0072] According to the Gaussian random function formula, the different noise coefficients required to be added to the target clear image are calculated. Wherein, the calculation formula of Gaussian random function is:
[0073]
[0074] According to the above calculation formula, different degrees of noise coefficients can be generated. The calculated noise coefficients are used to obtain the image of the target clear image after adding fusion noise to the clear image.
[0075] S132, in the order of noise increment, the noise is sequentially fused with the target clear image to obtain the fusion noise image. Please refer to Figure 4B and Figure 4C , respectively, show the process of gradually adding noise to the original image of pedestrians and the attribute label diagram of the original image in an embodiment of the attribute recognition model training method of the application, and the process of gradually adding noise to the original image of vehicles and the attribute label diagram of the original image in an embodiment of the attribute recognition model training method of the application.
[0076] As shown in Figure 4B and Figure 4C , the noise coefficient calculated by the Gaussian random function in step S131 is added to the clear image of the target clear image to obtain the fusion noise image of different noise coefficients.
[0077] In this embodiment, the process of adding different degrees of noise to the original image is processed by using diffusion probability model. The method is as follows:
[0078]
[0079] Wherein, α t =1-β t =1-0.001×t; t is the noise coefficient of different degrees; N(0,β t ) is noise; α t is the diffusion coefficient; is the cumulative product of the diffusion coefficient; X0 is the target image; X t is the fusion noise image.
[0080] Specifically, in the embodiment, t=5, 10, 20, 30, 40, 50, 100, etc. are preferred. The noise coefficient values obtained in step S131 are fused into the target clear image in order from small to large, and the fusion noise images of different noise coefficients are obtained. For example, in Figure 4B , the noise coefficients t=5, 10, 20, 40, 100, etc. are sequentially added to the clear image of the original target (e.g., a pedestrian) image, and the images of different noise coefficients t are obtained. In the original target clear image, different attributes on the target clear image can be clearly identified, including gender, age, upper garment, lower garment, hat, mask, and accompanying articles (e.g., a cross-body bag, a shoulder bag), etc. When the noise coefficient t=5, all the above attributes can be identified on the fusion noise image, but the clarity is reduced. When the noise coefficient t=10, all the above attributes can still be identified on the fusion noise image. By analogy, when the noise coefficient t=40, the human body contour can be identified on the fusion noise image, and other attributes cannot be identified. When the noise coefficient t=100, any target attribute cannot be identified on the fusion noise image.
[0081] For example, in Figure 4C , the noise coefficients t=30, 50, etc. are sequentially added to the clear image of the original target (e.g., a vehicle) image, and the noise fusion images of the vehicle with noise coefficients of 30 and 50 are obtained, respectively. In the original clear image of the vehicle, the attributes that can be identified include license plate, vehicle color, vehicle model, vehicle brand, vehicle series, etc. After adding noise with a coefficient of 30 to the original clear image of the vehicle, the attributes of vehicle, color, and model can be identified in the fusion noise image with t=30, and the attributes of license plate and vehicle series cannot be identified. After adding noise with a coefficient of 50 to the original clear image of the vehicle, only the attribute of the target category, such as vehicle, can be identified in the fusion noise image with t=50, and other attributes (e.g., color, brand, vehicle series, license plate) cannot be identified.
[0082] S14, identifying the fusion noise image based on the trained clear data attribute recognition model to obtain the effective attribute label of the fusion noise image.
[0083] Please refer to Figure 5 and Figure 6 , which respectively show the flowchart of S14 in the attribute recognition model training method of the application and the effective attribute label identification flowchart in an embodiment of the attribute recognition model training method of the application. As shown in Figure 5 and Figure 6 , the S14 includes the following steps:
[0084] S141, obtaining first attribute clear accuracy of each attribute of the target clear image based on the trained clear data attribute recognition model.
[0085] In this embodiment, the target clear image is input into the trained clear data attribute recognition model to obtain the first attribute clear accuracy of each attribute of the target clear image. The first attribute clear accuracy formula is: first attribute clear accuracy = number of correct recognition samples / total number of recognition samples.
[0086] Specifically, for example, the attributes contained in the pedestrian target clear image include gender, age, upper garment, lower garment, hat, mask, and accessories, etc. The gender attribute in the pedestrian target clear image corresponds to an attribute accuracy, i.e., the first gender attribute accuracy; the age attribute in the pedestrian target clear image corresponds to an accuracy, i.e., the first age attribute accuracy; the upper garment attribute in the pedestrian target clear image corresponds to an accuracy, i.e., the first upper garment attribute accuracy; the lower garment attribute in the pedestrian target clear image also corresponds to an accuracy, i.e., the first lower garment attribute accuracy. In turn, the first attribute clear accuracy of each attribute of the pedestrian target clear image can be obtained.
[0087] For another example, the attributes contained in the vehicle clear image include color, license plate, vehicle type, vehicle series, etc. The color attribute in the vehicle clear image corresponds to an attribute accuracy, i.e., the first color attribute accuracy; the license plate attribute in the vehicle clear image corresponds to an attribute accuracy, i.e., the first license plate attribute accuracy; the vehicle type attribute in the vehicle clear image corresponds to an attribute accuracy, i.e., the first vehicle type attribute accuracy; the vehicle series attribute in the vehicle clear image corresponds to an attribute accuracy, i.e., the first vehicle series attribute accuracy.
[0088] Therefore, the first attribute clear accuracy of each attribute of the target clear image is obtained by the trained clear data attribute recognition model.
[0089] S142, obtaining second attribute clear accuracy of each attribute of the fusion noise image based on the trained clear data attribute recognition model.
[0090] Similarly, the several fusion noise images obtained in S132 are input into the trained clear data attribute recognition model to obtain the second attribute clear accuracy of each attribute of the fusion noise image.
[0091] Specifically, the fusion noise image of the clear image of the pedestrian target has several. Therefore, each attribute corresponds to a second attribute clear accuracy. For example, assuming that there are four noise levels, there are three types of attributes A, B, C. Then, the specific accuracy has the following contents: accuracy A_clear image, accuracy B_clear image, accuracy C_clear image; accuracy A_noise degree 1, accuracy B_noise degree 1, accuracy C_noise degree 1; accuracy A_noise degree 2, accuracy B_noise degree 2, accuracy C_noise degree 2; accuracy A_noise degree 3, accuracy B_noise degree 3, accuracy C_noise degree 3; accuracy A_noise degree 4, accuracy B_noise degree 4, accuracy C_noise degree 4.
[0092] S143, obtaining an effective attribute label according to the first attribute clear accuracy and the second attribute clear accuracy.
[0093] Based on the first attribute clear accuracy and the second attribute clear accuracy obtained in the above steps, it is judged whether the second attribute clear accuracy is not lower than the product of the first attribute clear accuracy and a preset threshold, and then it is judged whether the attribute is an effective attribute label.
[0094] Specifically, when the second attribute clear accuracy is lower than the product of the first attribute clear accuracy and the preset threshold, it is judged that the corresponding label is an invalid attribute label; when the second attribute clear accuracy is greater than or equal to the product of the first attribute clear accuracy and the preset threshold, it is judged that the corresponding label is an effective attribute label.
[0095] The preset threshold calculation formula is:
[0096]
[0097] Wherein, t is the noise coefficient of different degrees; is the cumulative product of the diffusion coefficient of the noise in the fusion noise image. The value range of the preset threshold is between 0-1.
[0098] For example: according to the attribute accuracy in steps S141 and S142, when accuracy A_noise degree 3< accuracy A_clear image* coefficient, it is considered that when the noise degree 3, the attribute A label is invalid. When accuracy A_noise degree 2> accuracy A_clear image* coefficient, it is considered that when the noise degree 2, the attribute A label is an effective attribute label.
[0099] S15, training an attribute recognition model based on the fusion noise image and the corresponding effective attribute label, and performing attribute recognition on the image based on the trained attribute recognition model.
[0100] Please refer to Figure 7 , which shows the flowchart of S15 in the attribute recognition model training method of the application. As Figure 7As shown, the S15 comprises the following steps:
[0101] S151, initializing parameters of the attribute recognition model.
[0102] Parameter initialization is performed on the trained clear data attribute recognition model.
[0103] S152, training the attribute recognition model based on each fusion noise image and the corresponding effective attribute label in descending order of noise.
[0104] Each fusion noise image is trained in descending order of noise in combination with the corresponding effective attribute label.
[0105] Specifically, the pedestrian target is taken as an example. The pedestrian clear image is added to the fusion noise image with a noise coefficient t of 100 and the label is input into the attribute recognition model for training to form a new model, i.e., a first attribute recognition model. Then, the fusion noise image with a noise coefficient t of 90 is added and the label is input into the first attribute recognition model for training to obtain another new model, i.e., a second attribute recognition model. Iterative training is performed on the fusion noise image and the label with noise coefficients from large to small, respectively, to gradually generate a new model.
[0106] S153, training the attribute recognition model based on the target image and the corresponding attribute label again to obtain a trained attribute recognition model.
[0107] In the embodiment, the fusion noise image and the label are used to train the recognition network model, and the initial learning rate is reduced to times of the previous training learning rate. The value of ranges from 0 to 1.
[0108] The attribute recognition model obtained by training the target image and the corresponding attribute label again is iteratively trained, and the final attribute recognition model is the final attribute recognition network model.
[0109] The protection scope of the attribute recognition model training method according to the embodiments of the present application is not limited to the execution order of the steps listed in the embodiments, and any scheme realized by adding, replacing or replacing steps of the prior art according to the principles of the present application is included in the protection scope of the present application.
[0110] The embodiment further provides a computer readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the attribute recognition model training method as Figure 1 described above.
[0111] The present application can be a system, a method, and / or a computer program product at any possible technical detail level of integration. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present application.
[0112] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
[0113] The computer readable program described herein can be downloaded from a computer readable storage medium to various computing / processing devices, or to external computers or external storage devices via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions to storage media in the each computing / processing device for execution. The computer readable program instructions for carrying out operations of the present application can be in assembly code, instruction set architecture (ISA) code, machine code, machine dependent instructions, microcode, firmware instructions, state-setting data, integrated circuit configuration data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computing / processing device, partly on the user's computing / processing device, as a stand-alone software package, partly on the user's computing / processing device and partly on a remote computing / processing device or entirely on the remote computing / processing device or server. In the latter scenario, the remote computing / processing device can be connected to the user's computing / processing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing / processing device, such as through the Internet using an Internet Service Provider. In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present application.
[0114] The embodiment of the present application also provides an attribute recognition model training system, which can implement the attribute recognition model training method of the present application. However, the implementation device of the attribute recognition model training method of the present application is not limited to the structure of the attribute recognition model training system of the present embodiment, and any modification and replacement of the prior art according to the principle of the present application are included in the protection scope of the present application.
[0115] The attribute recognition model training system provided by the present embodiment will be described in detail below in combination with the drawings.
[0116] The present embodiment provides an attribute recognition model training system, comprising:
[0117] The acquisition module is configured to acquire a target clear image and an attribute label of the target clear image.
[0118] An identification training module is configured to train a clear data attribute identification model based on the target clear image and the attribute label.
[0119] A diffusion noise module is configured to add different degrees of noise to the target image to generate a plurality of fusion noise images.
[0120] A label generation module is configured to identify the fusion noise images based on the trained clear data attribute identification model to obtain effective attribute labels of the fusion noise images.
[0121] An inverse diffusion training module is configured to train an attribute identification model based on the fusion noise images and the corresponding effective attribute labels to perform attribute identification of images based on the trained attribute identification model.
[0122] Referring to FIG. 1, Figure 8 , which shows a schematic diagram of the principle structure of the attribute identification model training system according to an embodiment of the present application. As shown in Figure 8 , the attribute identification model training system comprises a collection module 81, an identification training module 82, a diffusion noise module 83, a label generation module 84 and an inverse diffusion training module 85.
[0123] The collection module 81 is configured to obtain a target clear image and an attribute label of the target clear image. Specifically, a still camera is used to capture a target region to obtain a collection image of the target region. The collection image is a clear image of the collection target. The target clear image type is a commonly used image type, such as RGB, RGBD, grayscale image, thermal image, etc.
[0124] After obtaining the target clear image, a corresponding label is marked on the target clear image by manual means.
[0125] The identification training module 82 is connected to the collection module 81 and is configured to train a clear data attribute identification model based on the target clear image and the attribute label.
[0126] The identification training module 82 inputs the target clear image and the attribute label into the clear data attribute identification model.
[0127] In this embodiment, an identification training network model is constructed according to user requirements.
[0128] Specifically, first, a training data set and a test data set are obtained. The training data set includes target clear images and attribute labels of the target clear images. Then, the target clear images and the attribute labels of the target clear images are input into an identification network model for training. Through continuous training, the identification network model is updated according to the identification result, and finally a clear data attribute identification model with updated labels is obtained.
[0129] The parameters of the clear data attribute identification model are adjusted so that the clear data attribute identification model outputs the effective attribute label of the target image. In this embodiment, by adjusting the parameters of the high-speed clear data attribute model, the effective attribute label of the target image is finally obtained through the clear data attribute identification model.
[0130] The diffusion noise module 83 is connected to the identification training module 82, and different degrees of noise are added to the target image to generate a plurality of fusion noise images.
[0131] Specifically, different degrees of noise are generated by using a Gaussian random function. In this embodiment, different degrees of noise N(0, β t ) are generated by using a Gaussian random function. Different degrees of noise have different noise degree coefficients, and the greater the noise degree coefficient, the greater the noise.
[0132] The noise coefficient calculated by the Gaussian random function is added to the clear image of the target clear image to obtain a fusion noise image with different noise coefficients.
[0133] The label generation module 84 is connected to the diffusion noise module 83, and is used to identify the fusion noise image based on the trained clear data attribute identification model to obtain the effective attribute label of the fusion noise image.
[0134] The target clear image is input into the trained clear data attribute identification model to obtain the first attribute clear precision of each attribute of the target clear image. The first attribute clear precision formula is: first attribute clear precision = number of correctly identified samples / total number of identified samples.
[0135] The second attribute clear precision of each attribute of the fusion noise image is obtained based on the trained clear data attribute identification model.
[0136] The effective attribute label is obtained according to the first attribute clear precision and the second attribute clear precision.
[0137] Based on the first attribute clear precision and the second attribute clear precision obtained in the above steps, it is judged whether the second attribute clear precision is not lower than the product of the first attribute clear precision and a preset threshold, and it is further judged whether the attribute is an effective attribute label.
[0138] Specifically, when the second attribute clarity precision is lower than the product of the first attribute clarity precision and a preset threshold, it is determined that the corresponding label is an invalid attribute label; when the second attribute clarity precision is greater than or equal to the product of the first attribute clarity precision and a preset threshold, it is determined that the corresponding label is a valid attribute label.
[0139] The inverse diffusion training module 85 is configured to train an attribute recognition model based on the fusion noise image and the corresponding valid attribute label, so as to perform attribute recognition on the image based on the trained attribute recognition model.
[0140] The trained clear data attribute recognition model is initialized in parameters.
[0141] The attribute recognition model is trained based on each fusion noise image and the corresponding valid attribute label in order of noise from large to small.
[0142] Each fusion noise image is trained in order of noise from large to small combined with the corresponding valid attribute label. Specifically, taking the pedestrian target as an example. The pedestrian clear image is added to the fusion noise image with a noise coefficient t of 100 and the label to input the attribute recognition model for training to form a new model, i.e., the first attribute recognition model. Then, the fusion noise image with a noise coefficient t of 90 and the label are input to the first attribute recognition model for training to obtain another new model, i.e., the second attribute recognition model. Iterative training is performed on the fusion noise image and the label with noise coefficients from large to small to gradually generate a new model.
[0143] Finally, the attribute recognition model is trained again based on the target image and the corresponding attribute label to obtain a trained attribute recognition model.
[0144] It should be noted that the division of each module of the above system is only a logical division of functions, and in actual implementation, all or part of the modules can be integrated into one physical entity, or can be physically separated. These modules can all be implemented in the form of software called by a processing element; all can be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. For example, the x module can be a separately established processing element, or can be integrated in a chip of the above system, in addition, it can also be stored in the form of program code in the memory of the above system, and the function of the above x module is called and executed by a processing element of the above system. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or can be independently implemented. The processing element described herein can be an integrated circuit having a signal processing capability. In the implementation process, each step of the above method or each module can be completed by the integrated logic circuit of the hardware in the processor element or the instruction in the form of software.
[0145] The above modules can be one or more integrated circuits configured to implement the above method, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), etc. For another example, when a certain module above is implemented in the form of program code called by a processing element, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules can be integrated together to implement in the form of system on a chip (SOC).
[0146] Please refer to Figure 9 , please refer to Figure 9 , which shows the principle structure of the attribute recognition model training device in an embodiment of the present application. As shown in Figure 9 , the embodiment provides an attribute recognition model training device, which comprises a processor 91 and a memory 92; the memory 92 is used to store a computer program; the processor 91 is connected with the memory 92, and is used to execute the computer program stored in the memory 92, so that the attribute recognition model training device executes each step of the human image age estimation method as described above.
[0147] Preferably, the memory can comprise a Random Access Memory (RAM) and can also comprise a non-volatile memory, such as at least one disk memory.
[0148] The processor described above can be a general processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0149] To sum up, the attribute recognition model training method, system, medium and device provided by the present application have the following beneficial effects:
[0150] The training method based on the diffusion model avoids the speculation part of the network in the training process, and can effectively identify the recognizable part in the attribute label reinforcement training according to the visual visible information; thereby avoiding the problem of upper limit loss of model recognition accuracy caused by the fusion of noise data and clear data with the same label in the training process, thereby improving and enhancing the attribute recognition model accuracy; effectively increasing the generalization ability of the recognition network. At the same time, the light design model structure is adopted, the requirement for the equipment is not high, and the applicability is strong. Therefore, the present application effectively overcomes various shortcomings in the prior art and has high industrial utilization value.
[0151] The above embodiments only exemplarily illustrate the principles and effects of the present application, and are not used to limit the present application. Any person skilled in the art can modify or change the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes completed by those skilled in the art without departing from the spirit and technical thought disclosed by the present application should be covered by the claims of the present application.
Claims
1. A method for training an attribute recognition model, the method comprising: The method comprises the following steps: obtaining a target clear image and an attribute label of the target clear image; training a clear data attribute recognition model based on the target clear image and the attribute label; adding different degrees of noise to the target clear image to generate a plurality of fusion noise images; identifying the fusion noise images based on the trained clear data attribute recognition model to obtain effective attribute labels of the fusion noise images; including: obtaining a first attribute clear precision of each attribute of the target clear image based on the trained clear data attribute recognition model; obtaining a second attribute clear precision of each attribute of the fusion noise images based on the trained clear data attribute recognition model; obtaining effective attribute labels according to the first attribute clear precision and the second attribute clear precision; wherein, when the second attribute clear precision is lower than the product of the first attribute clear precision and a preset threshold, it is judged that the corresponding label is an invalid attribute label; when the second attribute clear precision is greater than or equal to the product of the first attribute clear precision and a preset threshold, it is judged that the corresponding label is an effective attribute label; The preset threshold is where t is the noise coefficient of different degrees; is the cumulative product of the diffusion coefficient of noise in the fusion noise image; training an attribute recognition model based on the fusion noise images and the corresponding effective attribute labels, so as to perform attribute recognition of images based on the trained attribute recognition model. 2.The attribute recognition model training method of claim 1, wherein, Training a clear data attribute recognition model based on the target clear image and the attribute label comprises the following steps: inputting the target clear image and the attribute label into the clear data attribute recognition model; adjusting the parameters of the clear data attribute recognition model so that the clear data attribute recognition model outputs the effective attribute label of the target clear image. 3.The attribute recognition model training method of claim 1, wherein, Adding different degrees of noise to the target clear image to generate a plurality of fusion noise images comprises the following steps: generating different degrees of noise using a Gaussian random function; in accordance with the order of increasing noise, sequentially fuse the noise with the target clear image to obtain the fusion noise images. 4.The attribute recognition model training method of claim 3, wherein, The fusion noise images are: wherein, α t = 1 - β t = 1 - 0.001 x t; t is a different degree of noise coefficient; N(0, β t ) is noise; α t is a diffusion coefficient; is the cumulative product of the diffusion coefficient; X0 is the target clear image; X t is the fusion noise image. 5.The attribute recognition model training method of claim 1, wherein, Training an attribute recognition model based on the fusion noise images and the corresponding effective attribute labels, so as to perform attribute recognition of images based on the trained attribute recognition model comprises the following steps: initializing the parameters of the attribute recognition model; sequentially training the attribute recognition model based on each fusion noise image and the corresponding effective attribute label in accordance with the order of noise from large to small; retraining the attribute recognition model based on the target clear image and the corresponding attribute label to obtain a trained attribute recognition model.
6. An attribute recognition model training system, characterized by, It comprises: a collection module for obtaining a target clear image and an attribute label of the target clear image; an identification and training module for training a clear data attribute recognition model based on the target clear image and the attribute label; a diffusion noise module for adding different degrees of noise to the target clear image to generate a plurality of fusion noise images; The label generation module is configured to identify the fusion noise image based on the trained clear data attribute recognition model, and obtain an effective attribute label of the fusion noise image. The label generation module comprises: obtaining a first attribute clear accuracy of each attribute of the target clear image based on the trained clear data attribute recognition model; obtaining a second attribute clear accuracy of each attribute of the fusion noise image based on the trained clear data attribute recognition model; obtaining an effective attribute label according to the first attribute clear accuracy and the second attribute clear accuracy; wherein, when the second attribute clear accuracy is lower than a product of the first attribute clear accuracy and a preset threshold, it is determined that the corresponding label is an invalid attribute label; when the second attribute clear accuracy is greater than or equal to the product of the first attribute clear accuracy and the preset threshold, it is determined that the corresponding label is an effective attribute label; The preset threshold is where t is the noise coefficient of different degrees; is the cumulative product of the diffusion coefficient of noise in the fusion noise image; The inverse diffusion training module is configured to train an attribute recognition model based on the fusion noise image and the corresponding effective attribute label, so as to perform attribute recognition of an image based on the trained attribute recognition model.
7. An attribute recognition model training apparatus, characterized by comprising: comprise: a processor and a memory; the memory is configured to store a computer program; the processor is connected with the memory, and is configured to execute the computer program stored in the memory, so that the attribute recognition model training device executes the attribute recognition model training method in any one of claims 1 to 5.
Citation Information
Patent Citations
Image processing method and device, computer readable storage medium and electronic device
CN108764371A
Image recognition model training method and device and image recognition method and device
CN112307860A