Data conversion method, device, computer equipment and storage medium
Through DNA coding networks and deep learning technology, the complex and inefficient DNA data conversion process is solved, efficient and accurate data storage and high-dimensional data conversion are achieved, and DNA data that conforms to biological characteristics is generated.
Patent Information
- Application Number
- CN202111656976.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The existing DNA data conversion process is complicated, the conversion efficiency is low, and the DNA data obtained after conversion is difficult to meet the biological characteristics, and it is impossible to efficiently store high-dimensional data.
DNA encoding networks, including encoders and generators, use deep learning to perform DNA encoding and biometric enhancement processing on the converted data, build an initial reinforcement network for training, generate DNA data that meets biometric characteristics, and restore the data through the decoder.
It improves the efficiency and accuracy of DNA data conversion, realizes efficient and accurate data storage, solves the problems of complex conversion process and data not in line with biological characteristics in the existing technology, and supports the conversion and storage of high-dimensional data.
Smart Images

Figure CN114496033B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of bioinformatics technology, and in particular, to a data conversion method, apparatus, computer device, and storage medium. Background Art
[0002] With the continuous accumulation of digital information in modern society, the storage demand for data is increasing. Moreover, it will be very difficult for the currently used magnetic and optical media to meet the storage demand for future data. As a new type of information storage carrier, DNA has great advantages compared with traditional storage carriers. First, the storage time limit of DNA is relatively long. For example, when data is stored in dry and cool DNA, the data can be preserved for decades. Second, the storage density of DNA is extremely high, and 1g of DNA can store 215 million G of information.
[0003] Currently, when using DNA as an information storage carrier to store data, most of them use mathematical algorithms to deeply process the data, and then use binary / ternary / quaternary to map the data to DNA sequences. For example, when storing a piece of text, first, according to the character types and the GB2312-80 standard, re-encode the first-level or first- and second-level Chinese characters in the input text, then count the occurrence frequencies of text segmentation, sort the text segmentation, encode the top-ranked text segmentation, and then convert all the text into a binary sequence, perform Huffman coding compression, and then use a DNA quaternary conversion model to convert the compressed data into a DNA sequence for storing the text.
[0004] However, the above-mentioned data conversion method based on DNA sequences has the problem that the conversion process is complex, resulting in low conversion efficiency. Summary of the Invention
[0005] Based on this, it is necessary to provide a data conversion method, apparatus, computer device, and storage medium that can simplify the conversion process and effectively improve the conversion efficiency for the above technical problems.
[0006] In a first aspect, this application provides a data conversion method, and the method includes:
[0007] Obtain data to be converted;
[0008] Input the data to be converted into a preset DNA encoding network to obtain target DNA data; the DNA encoding network includes an encoder and a generator; the encoder is used to perform DNA encoding on the data to be converted, and the generator is used to perform biometric enhancement processing on the initial DNA data output by the encoder to obtain the target DNA data.
[0009] The above method encodes the input data to be converted through a DNA encoding network and performs biometric enhancement processing, and can obtain DNA data that conforms to biometric characteristics, overcoming the problems of the traditional DNA hard conversion method, such as complex conversion process resulting in low conversion efficiency, and the DNA data obtained after conversion being only the arrangement of four bases and being difficult to conform to biometric characteristics. In addition, after obtaining the DNA data that conforms to biometric characteristics, the above method can utilize the advantages of DNA storage technology to store the data to be converted efficiently, accurately and long-term, realizing the first introduction of deep learning into the DNA data conversion process and DNA storage technology, greatly improving the data conversion efficiency and accuracy.
[0010] In one embodiment, the method further includes:
[0011] Inputting the target DNA data into a decoder to obtain restored data; the similarity between the restored data and the data to be converted is greater than a preset similarity threshold.
[0012] The above method can realize the conversion of data to be converted into DNA data, and the conversion of DNA data into restored data. If the data to be converted is a picture, picture storage and conversion can be realized, solving the problem that the prior art cannot utilize DNA technology to realize high-dimensional data conversion.
[0013] In one embodiment, the method further includes:
[0014] Constructing an initial enhancement network, and training the initial enhancement network based on DNA data samples to obtain the generator; the initial enhancement network includes an initial generator and an initial discriminator;
[0015] Constructing an initial DNA encoding network based on the generator, the initial encoder and the initial decoder, and training the initial DNA encoding network based on data samples to be converted to obtain the DNA encoding network.
[0016] In one embodiment, the DNA data samples include positive DNA data samples and negative DNA data samples. Training the initial enhancement network based on the DNA data samples to obtain the generator includes:
[0017] Inputting the negative DNA data samples into the initial generator to obtain first enhanced DNA data;
[0018] Inputting the first enhanced DNA data and the positive DNA data samples into the initial discriminator to obtain a discrimination result;
[0019] Determining the loss function of the initial enhancement network according to the discrimination result;
[0020] Adjust the parameters of the initial generator and the parameters of the initial discriminator alternately according to the value of the loss function of the initial reinforcement network until the value of the loss meets the preset condition, and use the initial generator with adjusted parameters as the generator obtained after training.
[0021] The above embodiments achieve the ability of the generator to efficiently generate biometric DNA or real DNA sequence data through the adversarial training between the initial generator and the initial discriminator. For example, it can achieve DNA conforming to biometric features with a similarity of 98%.
[0022] In one of the embodiments, the initial reinforcement network further includes a function analyzer. Training the initial reinforcement network based on the DNA data samples to obtain the generator includes:
[0023] Input the DNA data samples into the initial generator to obtain second reinforced DNA data;
[0024] Input the second reinforced DNA data into the function analyzer for screening to obtain third reinforced DNA data;
[0025] Input the third reinforced DNA data and the second reinforced DNA data into the initial discriminator to obtain a discrimination result;
[0026] Determine the loss of the initial reinforcement network according to the discrimination result;
[0027] Adjust the parameters of the initial generator and the parameters of the initial discriminator alternately according to the loss of the initial reinforcement network until the loss meets the preset condition, and use the initial generator with adjusted parameters as the generator obtained after training.
[0028] The above embodiments screen the DNA data output by the generator by introducing a function analyzer, and enable the discriminator to learn based on the screened DNA data that truly conforms to biometric features, greatly improving the learning ability of the discriminator, reducing the preparation work of real DNA data samples, and improving the efficiency and accuracy of training.
[0029] In one of the embodiments, training the initial DNA encoding network based on the data samples to be converted to obtain the DNA encoding network includes:
[0030] Input the data samples to be converted into the initial encoder for DNA encoding to obtain first matrix data;
[0031] Input the first matrix data into the generator to obtain fourth reinforced DNA data;
[0032] Convert the fourth enhanced DNA data into second matrix data;
[0033] Input the second matrix data into the initial decoder for DNA decoding to obtain initial restored data;
[0034] Determine the loss function of the initial DNA encoding network according to the restored data and the data sample to be converted;
[0035] Alternately adjust the parameters of the initial encoder and the parameters of the initial decoder according to the value of the loss function of the initial DNA encoding network until the value of the loss function meets the preset condition. Then, use the initial encoder with adjusted parameters as the encoder obtained after training, and use the initial decoder with adjusted parameters as the decoder obtained after training. Construct the DNA encoding network according to the encoder obtained after training, the decoder obtained after training, and the generator.
[0036] In the training process described in the above embodiments, the trained generator is integrated into the initial DNA encoding network (autoencoding network) composed of an encoder and a decoder. The position of the generator is between the initial encoder and the initial decoder. The generator can accurately generate DNA data conforming to biometric features during the training process, which can improve the conversion efficiency and restoration degree of the initial DNA encoding network for the data to be converted. Moreover, the initial DNA encoding network includes two independent neural networks that need to be trained, namely the generator and the autoencoding network (encoder and decoder), and they are trained separately. They do not interfere with each other during training and can exert their maximum advantages respectively, so that the DNA encoding network obtained after training can accurately restore the data to be transmitted.
[0037] In one of the embodiments, the loss function of the initial DNA encoding network is a regular function.
[0038] In a second aspect, the present application also provides a data conversion device. The device includes:
[0039] An acquisition module, configured to acquire data to be converted;
[0040] A conversion module, configured to input the data to be converted into a preset DNA encoding network to obtain target DNA data; the DNA encoding network includes an encoder and a generator; the encoder is configured to perform DNA encoding on the data to be converted, and the generator is configured to perform biometric enhancement processing on the initial DNA data output by the encoder to obtain the target DNA data.
[0041] In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect above is implemented.
[0042] In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the method described in the first aspect above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 Schematic diagram of the internal structure of a computer device in an embodiment;
[0044] Figure 2 Schematic diagram of the process of a data conversion method in an embodiment;
[0045] Figure 2A Schematic diagram of the structure of a DNA encoding network in an embodiment;
[0046] Figure 3 Schematic diagram of the process of a data conversion method in an embodiment;
[0047] Figure 3A Schematic diagram of the structure of a data conversion network in an embodiment;
[0048] Figure 4 Schematic diagram of the process of a method for training a DNA encoding network in an embodiment;
[0049] Figure 4A Schematic diagram of the structure of an initial reinforcement network in an embodiment;
[0050] Figure 5 Schematic diagram of the process of a method for training an initial reinforcement network in an embodiment;
[0051] Figure 6 Schematic diagram of the process of a method for training an initial reinforcement network in an embodiment;
[0052] Figure 6A Schematic diagram of the structure of an initial reinforcement network in an embodiment;
[0053] Figure 7 Schematic diagram of the process of a method for training an initial DNA encoding network in an embodiment;
[0054] Figure 7A Schematic diagram of the structure of an initial DNA encoding network in an embodiment;
[0055] Figure 8 Schematic diagram of the structure of an image conversion network in an embodiment;
[0056] Figure 9 is a schematic flow chart of a data conversion method in an embodiment;
[0057] Figure 9A is a schematic diagram of a test curve in an embodiment;
[0058] Figure 9B is a schematic diagram of a test curve in an embodiment;
[0059] Figure 10 is a schematic structural diagram of a data conversion device in an embodiment. Detailed implementation manners
[0060] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] The data conversion method provided by the embodiments of the present application can be applied to a Figure 1 computer device as shown. The computer device can be a terminal, and its internal structure diagram can be as Figure 1 shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication) or other technologies. The computer program, when executed by the processor, implements a data conversion method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad or a mouse, etc.
[0062] Those skilled in the art can understand that Figure 1 the structure shown in
[0063] In an embodiment, as Figure 2As shown, a data conversion method is provided. Taking the computer device applied in Figure 1 as an example, the method includes the following steps:
[0064] S101, obtain the data to be converted.
[0065] Among them, the data to be converted can include any type of data such as text, letters, numbers, pictures, audio, and video. In this embodiment, when it is necessary to store data using a DNA information storage carrier, the data to be stored, that is, the data to be converted, can be obtained first. Specifically, the computer device can obtain any type of data to be converted input by the user for later execution of the method for converting and storing the data to be converted; optionally, the computer device can also download or obtain the data to be converted from other devices for later execution of the method for converting and storing the data to be converted.
[0066] S102, input the data to be converted into a preset DNA encoding network to obtain target DNA data.
[0067] Among them, the DNA encoding network includes an encoder and a generator (see the structural schematic diagram of the DNA encoding network shown in Figure 2A ); the encoder is used to perform DNA encoding on the data to be converted, and the generator is used to perform biometric enhancement processing on the initial DNA data output by the encoder to obtain target DNA data. The target DNA data is the DNA data after DNA encoding, and the target DNA data generated by the DNA encoding network is more in line with biometric characteristics or real DNA sequence data. The encoder can be a neural network that encodes data through the neural network to generate data that meets the encoding requirements. The generator can be a neural network that generates data that meets specific requirements from the input data.
[0068] In this embodiment, the computer device can pre-construct and train a DNA encoding network based on relevant algorithms of deep learning, as well as a large number of data samples and DNA data samples, so that the DNA encoding network can be used to convert data into DNA data that meets biometric characteristics or is real. Then, in actual application, the data to be converted can be directly input into the trained DNA encoding network (see the encoding network shown in Figure 2A ) to obtain target DNA data.
[0069] The data conversion method provided by the above embodiments obtains the data to be converted and inputs the data to be converted into a preset DNA encoding network to obtain target DNA data. Among them, the DNA encoding network includes an encoder and a generator. The encoder is used to perform DNA encoding on the data to be converted, and the generator is used to perform biometric enhancement processing on the initial DNA data output by the encoder to obtain target DNA data. The above method can perform DNA encoding and biometric enhancement processing on the input data to be converted through the DNA encoding network, and can obtain DNA data that conforms to biometric characteristics, overcoming the problems that the traditional DNA hard conversion method has a complex conversion process resulting in low conversion efficiency, and the DNA data obtained after conversion is only an arrangement of four bases and is difficult to conform to biometric characteristics. In addition, after obtaining the DNA data that conforms to biometric characteristics, the above method can utilize the advantages of DNA storage technology to store the data to be converted efficiently, accurately and long-term, realizing the first introduction of deep learning into the DNA data conversion process and DNA storage technology, and greatly improving the data conversion efficiency and accuracy.
[0070] In practical applications, when the computer device converts the data to be converted into target DNA data based on Figure 2 the method described in the embodiments, it can realize storing the data to be converted using the target DNA data. Based on this, the present application also provides a method for restoring data from a DNA sequence. As Figure 3 shown, on the basis of the method described in the embodiment of FIG. 2, this method further includes the steps:
[0071] S103, input the target DNA data into a decoder to obtain restored data.
[0072] Among them, the similarity between the restored data and the data to be converted is greater than a preset similarity threshold. The preset similarity threshold can be determined in advance by the computer device according to the similarity or restoration degree requirements of the data. For example, the preset similarity threshold can be different values such as 95%, 97%, 99%, etc. If the similarity between the restored data and the data to be converted is greater than the preset similarity threshold, it means that the restored data is basically the same as the data to be converted, that is, the restored data basically restores all the characteristics of the data to be converted. The decoder is used to decode DNA data. The decoder can be a neural network, and the data is decoded through the neural network into general data, such as picture data, text data, etc.
[0073] In this embodiment, the computer device can pre-construct a data conversion network according to the encoder, the generator and the decoder (see the network shown in Figure 3A ), and then train the network based on a large number of data samples to obtain a decoder that can decode DNA data. When the computer device is based on the foregoing Figure 2When the method described in the embodiment obtains the target DNA data, it is equivalent to storing the data to be converted in the DNA data. When the data to be converted needs to be used later, the data to be converted also needs to be restored from the DNA data. At this time, the target DNA data can be input into a pre-trained decoder for DNA data decoding to restore the data to be converted and obtain the restored data. The restoration degree of the restored data relative to the data to be converted, that is, the similarity between the restored data and the data to be converted, is very high. Combining with the foregoing Figure 2 The method described in the embodiment realizes the conversion of the data to be converted into DNA data and the conversion of DNA data into restored data. If the data to be converted is a picture, picture storage and conversion can be realized, solving the problem that the prior art cannot use DNA technology to realize high-dimensional data conversion. It should be noted that the decoder in this embodiment corresponds to the encoder in the foregoing embodiment and is obtained simultaneously through the same training method. The training process will be described in the subsequent embodiments. For detailed content, please refer to the subsequent description and will not be elaborated here.
[0074] The DNA encoding network in the above embodiment can be pre-trained. Therefore, the present application also provides a method for training the DNA encoding network, such as Figure 4 shown, the method includes:
[0075] S201, construct an initial reinforcement network, and train the initial reinforcement network based on DNA data samples to obtain a generator.
[0076] Among them, the initial reinforcement network includes an initial generator and an initial discriminator. The initial generator can be a neural network that generates specific data outputs from input data through the neural network; the initial discriminator can be a neural network that judges the authenticity of input data. The initial discriminator in this embodiment is used to judge whether the input enhanced DNA data conforms to biological characteristics or is real DNA sequence data. In practical applications, the above initial reinforcement network can be a generative adversarial network (GAN), and its generative adversarial network algorithm can obtain a generator for enhancing biological characteristics through adversarial training.
[0077] In this embodiment, the computer device can first construct an initial reinforcement network according to the initial generator and the initial discriminator. Refer to the initial reinforcement network shown in Figure 4A Then obtain DNA data samples and train the constructed initial reinforcement network based on the DNA data samples.
[0078] Furthermore, the following method can be used to train the above initial reinforcement network to obtain a trained generator. The specific training method is as follows Figure 5 shown, including:
[0079] In S2011, input the negative DNA data sample into the initial generator to obtain the first enhanced DNA data.
[0080] Among them, when the computer device obtains a DNA data sample, it can first preprocess the DNA data sample and label the DNA data sample. Specifically, the DNA data sample that conforms to the biological characteristics can be labeled as 1, and the remaining DNA data samples can be labeled as 0. For example, the following labeling method (1) can be adopted:
[0081]
[0082] Among them, y represents the DNA data sample. The DNA data sample labeled as conforming to the biological characteristics is a positive DNA data sample, and the DNA data sample labeled as not conforming to the biological characteristics is a negative DNA data sample.
[0083] See Figure 4A As shown in the initial enhancement network, during training, input the negative DNA data sample into the initial generator to obtain the first enhanced DNA data. This first enhanced DNA data is a sequence similar to DNA, but it does not necessarily conform to the biological characteristics.
[0084] In S2012, input the first enhanced DNA data and the positive DNA data sample into the initial discriminator to obtain the discrimination result.
[0085] Following the above steps, the computer device inputs the first enhanced DNA data and the positive DNA data sample into the initial discriminator at the same time, and uses the initial discriminator to effectively identify the authenticity of the first enhanced DNA data. If the first enhanced DNA data is "true", it means that the first enhanced DNA data is a DNA data that conforms to the biological characteristics, that is, a DNA data that is consistent with the biological characteristics of the positive DNA data sample; if the first enhanced DNA data is "false", it means that the first enhanced DNA data is a DNA data that does not conform to the biological characteristics, that is, a DNA data that is inconsistent with the biological characteristics of the positive DNA data sample; the initial discriminator outputs the discrimination result by learning the biological characteristics of the positive DNA data sample. This discrimination result represents the probability that the biological characteristics of the first enhanced DNA data are consistent with the biological characteristics of the positive DNA data sample. The greater this probability, the more the first enhanced DNA data output by the generator conforms to the biological characteristics, and the smaller this probability, the less the first enhanced DNA data output by the generator conforms to the biological characteristics.
[0086] In S2013, determine the loss function of the initial enhancement network according to the discrimination result.
[0087] When the computer device obtains the discrimination result, it can further construct the loss function of the initial reinforcement network according to the discrimination result. The loss function can be determined by the Jensen-Shannon divergence between the distribution of the first reinforced DNA data output by the generator and the distribution of the positive DNA data samples. The specific expression can select the following relational expression (2):
[0088]
[0089] Among them, P data (x) represents the set of positive DNA data samples; P(z) represents the set of the first reinforced DNA data; D(x) represents the distribution function of the positive DNA data samples; G(z) represents the distribution function of the first reinforced DNA data. represents the expected value of D(x); E z∈P(z) [log(1 - D(G(z))] represents the expected value of G(z). V represents the Jensen-Shannon divergence between the distribution of the first reinforced DNA data and the distribution of the positive DNA data samples.
[0090] S2014. Alternately adjust the parameters of the initial generator and the parameters of the initial discriminator according to the value of the loss function of the initial reinforcement network until the loss value meets the preset conditions, and use the initial generator with adjusted parameters as the generator obtained after training.
[0091] Since the initial generator and the initial discriminator can form an adversarial training, the loss function can be determined by the discrimination result output by the defined initial discriminator, and the optimal discriminator can be obtained. Specifically, the calculation of the loss is generated at the output of the initial discriminator, and the output of the initial discriminator is generally a judgment of "true" or "false". In the max part of the above formula, during training, the parameters of the initial generator can be kept unchanged first to train the initial discriminator. The training objective of the initial discriminator is to correctly distinguish the real DNA sequence or the generated DNA that conforms to the biological characteristics. That is, if 1 / 0 represents the real DNA sequence or the generated DNA that conforms to the biological characteristics, then for the first term E in the above relational formula (2), since the sampling is the real DNA, that is, the positive DNA data sample, the expected value of D(x) approaches 1; similarly, in the second term E, since the sampling is the first enhanced DNA data generated by the initial generator, the expected value of D(G(z)) approaches 0. After adjusting the parameters of the initial discriminator to train the initial discriminator, the initial generator can be further trained based on the value of the loss function according to the trained initial discriminator. In this way, the training is alternated, that is, the parameters of the initial generator and the initial discriminator are alternately adjusted according to the value of the loss function until the value of the loss meets the preset conditions. The preset conditions can be that the probability that the discrimination result output by the discriminator represents that the biological characteristics of the first enhanced DNA data are consistent with the biological characteristics of the positive DNA data sample is the preset probability value, generally a probability value of 0.5. Finally, the initial generator with adjusted parameters is used as the generator obtained after training, that is Figure 2 The generator used in the embodiment.
[0092] It should be noted that this embodiment completes the process of alternating training. During the alternating training process, the initial discriminator can be trained with a part of the data samples, and then the initial generator can be trained with a part of the data samples. After completing one round of alternating training, the process can be repeated for a second, third, or multiple times until the value of the loss function meets the preset conditions. The above embodiment realizes that through the mutual adversarial training of the initial generator and the initial discriminator, the generator can efficiently generate DNA or real DNA sequence data that conforms to the biological characteristics. For example, DNA that conforms to the biological characteristics with a similarity of 98% can be achieved.
[0093] Furthermore, if the initial reinforcement network further includes a functional analyzer, that is, the initial reinforcement network is a feedback generative adversarial network, such as Figure 6A The initial reinforcement network shown can be trained by the following method to obtain the trained generator. The specific training method is as Figure 6 shown and includes:
[0094] S2015, input the DNA data sample into the initial generator to obtain the second enhanced DNA data.
[0095] See Figure 6A As shown in the initial enhancement network, during training, DNA data samples are input into the initial generator to obtain second-enhanced DNA data, which is a DNA-like sequence but may not necessarily conform to biological characteristics.
[0096] In S2016, the second-enhanced DNA data is input into the function analyzer for screening to obtain third-enhanced DNA data.
[0097] Among them, the function analyzer is used to screen the input DNA data, responsible for screening out DNA data that conforms to biological characteristics or real DNA data, which can be screened by scoring or other methods. The third-enhanced DNA data is DNA data that conforms to biological characteristics or real DNA data.
[0098] Following the above steps, the computer device inputs the second-enhanced DNA data into the function analyzer. Using this function analyzer, DNA data that conforms to biological characteristics or real DNA data can be screened out from the second-enhanced DNA data output by the generator to obtain third-enhanced DNA data. After the function analyzer performs the screening, the screened third-enhanced DNA data is input into the initial discriminator as positive sample data, so that the initial discriminator can effectively identify whether the second-enhanced DNA data output by the generator conforms to biological characteristics or is a real DNA sequence based on this positive sample data.
[0099] In S2017, the third-enhanced DNA data and the second-enhanced DNA data are input into the initial discriminator to obtain a discrimination result.
[0100] Following the above steps, the computer device inputs the second-enhanced DNA data output by the generator and the third-enhanced DNA data output by the function analyzer into the initial discriminator at the same time. Using this initial discriminator, the authenticity of the second-enhanced DNA data can be effectively identified. If the second-enhanced DNA data is "true", it means that this second-enhanced DNA data is DNA data that conforms to biological characteristics, that is, DNA data with the same biological characteristics as the third-enhanced DNA data; if the second-enhanced DNA data is "false", it means that this second-enhanced DNA data is DNA data that does not conform to biological characteristics, that is, DNA data with different biological characteristics from the third-enhanced DNA data; the initial discriminator outputs a discrimination result, which represents the probability that the biological characteristics of the second-enhanced DNA data are consistent with the biological characteristics of the third-enhanced DNA data. The greater this probability, the more the second-enhanced DNA data output by the generator conforms to biological characteristics, and the smaller this probability, the less the second-enhanced DNA data output by the generator conforms to biological characteristics.
[0101] In S2018, determine the loss function of the initial enhancement network according to the discrimination result.
[0102] This embodiment relates to a method for determining a loss function, which is based on the method described in S2013 above. For details, please refer to the foregoing description and will not be elaborated here.
[0103] S2019. Alternately adjust the parameters of the initial generator and the initial discriminator according to the value of the loss function of the initial reinforcement network until the loss meets the preset conditions, and use the initial generator with adjusted parameters as the generator obtained after training.
[0104] This embodiment relates to a method for alternately training an initial generator and an initial discriminator, which is based on the method described in S2014 above. For details, please refer to the foregoing description and will not be elaborated here.
[0105] It should be noted that there is another training method, that is Figure 6A The functional analyzer in the initial reinforcement network shown is also a neural network. Through this neural network, it is judged whether the input DNA data conforms to the biological characteristics and the DNA data that truly conforms to the biological characteristics is output. The functional analyzer can be composed of two Gated Recurrent Units (GRUs). Its training objective can be to input a DNA sequence, output the probability that the sequence conforms to the biological characteristics, and screen out the DNA sequences with high probabilities, that is, screen out the DNA data that truly conforms to the biological characteristics. For example, the training batchsize is 64, and training is carried out for 30 epochs with a learning rate of 0.001.
[0106] When training based on the above initial reinforcement network, the loss function of the initial reinforcement network is still determined according to the discrimination result output by the initial discriminator. Then, according to the value of the loss function, the parameters of the initial generator, the parameters of the initial discriminator, and the parameters of the function analyzer are alternately adjusted until the loss meets the preset conditions. And the initial generator with adjusted parameters is used as the generator obtained after training. During the specific alternating training, the generator can be trained first to ensure that it generates DNA-like sequences, but not necessarily meeting the biological characteristics. Secondly, the function analyzer is trained so that the function analyzer can effectively output the probability that the input DNA data conforms to the biological characteristics, and the DNA data with high probability is screened out. During the specific training process, a part of the DNA data generated by the initial generator can be input into the function analyzer. The function analyzer will predict the authenticity rate of each DNA sequence (the probability of DNA conforming to the biological characteristics), and input the DNA sequences with higher authenticity rate to the initial discriminator to replace the sequences with lower authenticity rate in the initial discriminator to make it learn more efficiently. Through the above embodiments, by introducing a function analyzer to screen the DNA data output by the generator and enabling the discriminator to learn based on the DNA data that truly conforms to the biological characteristics, the learning ability of the discriminator is greatly improved, and the preparation work of real DNA data samples is reduced, improving the efficiency and accuracy of training.
[0107] S202. Construct an initial DNA encoding network based on the generator, the initial encoder, and the initial decoder, and train the initial DNA encoding network based on the data samples to be converted to obtain a DNA encoding network.
[0108] When the computer device obtains the trained generator based on the method described in the foregoing S201 step, it can construct an initial DNA encoding network based on the generator, the initial encoder, and the initial decoder. Refer to Figure 7A the initial DNA encoding network shown, and then obtain the data samples to be converted, and train the constructed initial DNA encoding network based on the data samples to be converted.
[0109] Furthermore, the following method can be used to train the above initial DNA encoding network. The specific training method is as Figure 7 shown, and includes:
[0110] S2021. Input the data samples to be converted into the initial encoder for DNA encoding to obtain the first matrix data.
[0111] Among them, when the computer device obtains the data samples to be converted, it can first preprocess the data samples to be converted. For example, if the data to be converted is image data, format, size, etc. conversion processing can be performed on the image data set. Refer to Figure 7AFor the initial DNA coding network shown, during training, the data sample to be converted is input into the initial encoder for DNA coding to obtain the first matrix data, which can represent a DNA sequence but may not necessarily conform to biological characteristics. The first matrix data can be a two-dimensional vector matrix or a multi-dimensional vector matrix. The dimension of the first matrix data is the same as that of the data to be converted. For example, if the data to be converted is a two-dimensional image, the corresponding first matrix data is a two-dimensional vector matrix.
[0112] S2022: Input the first matrix data into the generator to obtain the fourth enhanced DNA data.
[0113] Following the above steps, the computer device inputs the first matrix data into the generator to obtain DNA data that conforms to biological characteristics, namely the fourth enhanced DNA data.
[0114] S2023: Convert the fourth enhanced DNA data into the second matrix data.
[0115] Specifically, the fourth enhanced DNA data is expressed using matrix data, that is, the fourth enhanced DNA data is converted into the second matrix data; optionally, a corresponding data converter or conversion algorithm can also be used to convert the fourth enhanced DNA data into the second matrix data. It should be noted that the dimension of the second matrix data is the same as that of the first matrix data. For example, if the first matrix data is a two-dimensional vector matrix, the corresponding second matrix data is also a two-dimensional vector matrix.
[0116] S2024: Input the second matrix data into the initial decoder for DNA decoding to obtain the initial restored data.
[0117] Among them, the dimension of the initial restored data is the same as that of the data sample to be converted. For example, if the data sample to be converted is a two-dimensional image, the initial restored data is also a two-dimensional image.
[0118] This embodiment relates to an inverse conversion method for DNA data, which is essentially to restore the fourth enhanced DNA data to other types of data. Specifically, when the computer device obtains the second matrix data that can represent the fourth enhanced DNA data, it can directly input the second matrix data into the initial decoder for decoding to obtain the initial restored data, making the similarity between the initial restored data and the data to be converted extremely high, that is, the initial restored data is basically restored to the data to be converted.
[0119] S2025: Determine the loss function of the initial DNA coding network according to the restored data and the data sample to be converted.
[0120] Among them, the loss function of the initial DNA coding network can be a regularization function.
[0121] The computer device can construct the loss function of the initial DNA encoding network according to the regular algorithm. Optionally, when the data sample to be converted is image data, the following relational expression (3) can be used to determine the loss function:
[0122]
[0123] where L is the loss function of the image pixels; the index i loops through all the pixel points in an image. y i is the pixel at position i in the image corresponding to the data to be converted, and f(x i ) is the pixel at position i in the image corresponding to the initially restored data after regeneration. Take the difference between the two, and for the difference between the regenerated image and the image before conversion, and use the function of this difference as the loss function.
[0124] S2026. Alternately adjust the parameters of the initial encoder and the initial decoder according to the value of the loss function of the initial DNA encoding network until the value of the loss function meets the preset condition. Then, use the initial encoder with adjusted parameters as the encoder obtained after training, and use the initial decoder with adjusted parameters as the decoder obtained after training. And construct the DNA encoding network according to the encoder obtained after training, the decoder obtained after training, and the generator.
[0125] In this embodiment, when the computer device calculates the value of the loss function of the initial DNA encoding network for each training, that is, the difference between the data sample to be converted and the initial original data, since the training objective is to make the data sample to be converted as close as possible to the initial original data, for example, the original image and the restored image are as close as possible, that is, to make the difference between the data sample to be converted and the initial original data as small as possible. Therefore, taking the minimization of the value of the loss function as the objective and using this objective as the preset condition, adjust the parameters of the initial encoder and the initial decoder until the value of the loss function meets the preset condition. Then, use the initial encoder with adjusted parameters as the encoder obtained after training, and use the initial decoder with adjusted parameters as the decoder obtained after training. And construct the DNA encoding network according to the encoder obtained after training, the decoder obtained after training, and the generator, that is, the DNA encoding network used in the foregoing Figure 2 embodiment.
[0126] In the training process described in the above embodiments, the trained generator is integrated into the initial DNA encoding network (autoencoder network) composed of an encoder and a decoder. The generator is located between the initial encoder and the initial decoder. During the training process, the generator can accurately generate DNA data that conforms to biometric characteristics, which can improve the conversion efficiency and restoration degree of the initial DNA encoding network for the data to be converted. Moreover, the initial DNA encoding network includes two independent neural networks that need to be trained, namely the generator and the autoencoder network (encoder and decoder), and they are trained separately. During training, they do not interfere with each other and can exert their maximum advantages, so that the DNA encoding network obtained after training can accurately restore the data to be transmitted.
[0127] In summary of all the above embodiments, the present application also provides an image conversion network, as Figure 8 shown. The image conversion network includes: an FBGAN network and an AE autoencoder network; wherein, the FBGAN network is a feedback generative adversarial network, which is used to be trained based on the input DNA training data. During this process, the parameters of the FBGAN network are adjusted until the FBGAN network is trained, and then a DNA generator is output. The autoencoder network is constructed by the DNA generator, an encoder, and a decoder. After the FBGAN network is trained, it can be trained based on the image training data. During this process, the parameters of the AE autoencoder network are adjusted. After the AE autoencoder network is trained, it can perform image conversion based on the image test data, converting the input image test data (image) into a restored image, and the restored image is extremely close to the image corresponding to the image test data. For the specific training processes of the FBGAN network and the AE autoencoder network respectively, reference can be made to the training methods described in the foregoing Figure 5 、 Figure 6 and Figure 7 embodiments, which will not be elaborated here.
[0128] In summary of all the above embodiments, a data conversion method is provided, as Figure 9 shown. The method includes:
[0129] S301, constructing an initial reinforcement network, and training the initial reinforcement network based on DNA data samples to obtain a generator.
[0130] S302, constructing an initial DNA encoding network based on the generator, an initial encoder, and an initial decoder, and training the initial DNA encoding network based on data samples to be converted to obtain a DNA encoding network.
[0131] S303, obtaining the data to be converted.
[0132] S304, inputting the data to be converted into a preset DNA encoding network to obtain target DNA data.
[0133] S305. Input the target DNA data into a decoder to obtain restored data.
[0134] The methods described in the above steps have been explained above and will not be elaborated here.
[0135] Exemplarily illustrate the data conversion effect of the above data conversion method and data conversion network:
[0136] For example, when using the data conversion method and data conversion network provided in the above embodiments for image conversion, refer to the schematic diagram of the test curve as shown in Figure 9A In the figure, the abscissa represents the number of samples of the training data, that is, epoch, and the ordinate represents the reconstruction loss (the loss of the AE autoencoder network and the loss of the FBGAN network (feedback generation network)). The schematic diagram of the training result shown in FIG. 9A is a test comparison diagram of the first 100 epochs at a learning rate of 0.0001 / 0.0002 under the training volume of 51,200. It can be seen that at the same training volume and different learning rates, the higher the learning rate, the lower the corresponding reconstruction loss. At epoch = 10, the reconstruction loss is the lowest. Therefore, it can be selected for optimal training during the training process. The training results are as follows: the accuracy of image regeneration can reach about 89%, and the accuracy of the DNA conforming to biometric features generated by the generator in the FBGAN network (feedback generation network) is 98%.
[0137] Refer to the schematic diagram of the test curve as shown in Figure 9B This figure is a comparative test diagram with the same learning rate, different training volumes and epochs. It can be clearly seen from the figure that since the generator in the FBGAN network (feedback generation network) has completed training, no parameter adjustment is required for it during the training of the AE autoencoder network, that is, the accuracy of the DNA it generates remains at the level of 98%. Since the AE autoencoder network has not completed training, when the training volume increases from 32,000 to 544,000, the reconstruction loss between the regenerated image and the original image drops from 12.24% to 11.62%, and the accuracy of the regenerated image continuously improves.
[0138] In summary, first, the present application proposes a DNA data conversion technology based on autoencoders and feedback generative adversarial networks, which improves the accuracy of generating biometric DNA and regenerating pictures, and realizes the mutual conversion of biometric DNA and picture data through deep learning. Currently, the DNA encoding and storage data technologies are all hard conversions of data into DNA, and can only convert a single language, with great limitations, and the generated DNA does not conform to biometric characteristics. The data conversion network proposed in the present application separates the problem of mutual conversion between biometric DNA and pictures into the problem of artificially synthesizing biometric DNA and the problem of picture regeneration, which not only improves the accuracy of generating biometric DNA, but also improves the accuracy of picture conversion, making up for the defect that high-dimensional data cannot be converted in the existing DNA conversion technology. Second, the present application realizes a DNA storage technology based on the AE autoencoder network and the FBGAN network (feedback generative network). By integrating the FBGAN network and the AE autoencoder network, deep learning is first introduced into the field of DNA storage, filling the gap in this field.
[0139] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0140] Based on the same inventive concept, the embodiments of the present application also provide a data conversion device for implementing the data conversion method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more of the following data conversion device embodiments can refer to the limitations on the data conversion method in the above text, and will not be repeated here.
[0141] In one embodiment, as Figure 10 shown, a data conversion device is provided, including:
[0142] An acquisition module 11, configured to acquire data to be converted;
[0143] A conversion module 12 for inputting the data to be converted into a preset DNA encoding network to obtain target DNA data; the DNA encoding network includes an encoder and a generator; the encoder is used to perform DNA encoding on the data to be converted, and the generator is used to perform biometric enhancement processing on the initial DNA data output by the encoder to obtain the target DNA data.
[0144] Each module in the above data conversion device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form so that the processor can call and execute the operations corresponding to each of the above modules.
[0145] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0146] Obtain the data to be converted;
[0147] Input the data to be converted into a preset DNA encoding network to obtain target DNA data; the DNA encoding network includes an encoder and a generator; the encoder is used to perform DNA encoding on the data to be converted, and the generator is used to perform biometric enhancement processing on the initial DNA data output by the encoder to obtain the target DNA data.
[0148] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0149] Obtain the data to be converted;
[0150] Input the data to be converted into a preset DNA encoding network to obtain target DNA data; the DNA encoding network includes an encoder and a generator; the encoder is used to perform DNA encoding on the data to be converted, and the generator is used to perform biometric enhancement processing on the initial DNA data output by the encoder to obtain the target DNA data.
[0151] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0152] Obtain the data to be converted;
[0153] Input the data to be converted into a preset DNA encoding network to obtain target DNA data; the DNA encoding network includes an encoder and a generator; the encoder is used to perform DNA encoding on the data to be converted, and the generator is used to perform biometric enhancement processing on the initial DNA data output by the encoder to obtain the target DNA data.
[0154] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. 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 methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0155] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0156] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A data conversion method, characterized in that, The method includes: Constructing an initial reinforcement network; the initial reinforcement network includes an initial generator, an initial discriminator, and a function analyzer; Inputting a DNA data sample into the initial generator to obtain a second reinforced DNA data; Inputting the second reinforced DNA data into the function analyzer for screening to obtain a third reinforced DNA data; the third reinforced DNA data is DNA data that conforms to biological characteristics or real DNA data; Inputting the third reinforced DNA data and the second reinforced DNA data into the initial discriminator to obtain a discrimination result; Determining the loss function of the initial reinforcement network according to the discrimination result; Alternately adjusting the parameters of the initial generator and the parameters of the initial discriminator according to the value of the loss function of the initial reinforcement network until the value of the loss function meets a preset condition, and using the initial generator with adjusted parameters as the generator obtained after training; Constructing an initial DNA encoding network based on the generator, an initial encoder, and an initial decoder; Inputting a data sample to be converted into the initial encoder for DNA encoding to obtain a first matrix data; inputting the first matrix data into the generator to obtain a fourth reinforced DNA data, converting the fourth reinforced DNA data into a second matrix data, and inputting the second matrix data into the initial decoder for DNA decoding to obtain an initial restored data; the first matrix data is used to represent a DAN sequence, and the fourth reinforced DNA data is DNA data that conforms to biological characteristics; Determining the loss function of the initial DNA encoding network according to the initial restored data and the data sample to be converted; training the initial encoder and the initial decoder according to the loss function of the initial DNA encoding network to obtain a DNA encoding network including an encoder and the generator; Obtaining data to be converted, and inputting the data to be converted into the DNA encoding network to obtain target DNA data; the DNA encoding network includes an encoder and a generator; the encoder is used for DNA encoding the data to be converted, and the generator is used for performing biological characteristic enhancement processing on the initial DNA data output by the encoder to obtain the target DNA data.
2. The method according to claim 1, wherein The method further includes: Inputting the target DNA data into a decoder to obtain restored data; the similarity between the restored data and the data to be converted is greater than a preset similarity threshold.
3. The method according to claim 1 or 2, characterized in that, The dimension of the initial restored data is the same as the dimension of the data sample to be converted.
4. The method according to claim 1 or 2, characterized in that, The dimension of the first matrix data is the same as the dimension of the data to be converted.
5. A data conversion device for implementing the data conversion method as described in claim 1, characterized in that, The device includes: An acquisition module, configured to acquire data to be converted; A conversion module, configured to input the data to be converted into a preset DNA encoding network to obtain target DNA data; the DNA encoding network includes an encoder and a generator; the encoder is used for DNA encoding the data to be converted, and the generator is used for performing biological characteristic enhancement processing on the initial DNA data output by the encoder to obtain the target DNA data.
6. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1-4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Data conversion method and device, encoder learning method and device, and program
JP2020061023A