The present application is based on, and claims priority from JP Application Serial Number 2023-056834, filed Mar. 31, 2023, the disclosure of which is hereby incorporated by reference herein in its entirety.
The present disclosure relates to a technique for generating a data processing sequence.
According to the related art, a technique of structurally expressing an individual as a tree structure by using genetic programming is known. JP-A-2007-87055 is an example of the related-art technique. In the related-art technique, an image processing sequence formed of a plurality of image processing filters combined together in a tree structure is generated by using genetic programming.
In the technique of JP-A-2007-87055, by using genetic programming, a plurality of image processing sequences are generated and an image processing sequence that satisfies a criterion is specified. In some cases, for an image processing filter, a plurality of necessary parameters for image processing are prepared for each type of parameter. When an image processing sequence is generated, such parameters are set. In the technique of JP-A-2007-87055, a parameter is added to a gene that expresses an image input layer or an image filter that forms an individual. In this case, when generating a plurality of individuals expressing a plurality of image processing sequences, it may be difficult to easily generate an individual, paying attention to a parameter such as adding a change to a parameter of a certain image processing filter. Such a problem not only occurs in the generation of an image processing sequence to process an image but also similarly occurs in the generation of a data processing sequence to process various data such as an image or a voltage change.
According to a first aspect of the present disclosure, a method for generating a data processing sequence is provided. The data processing sequence has an input layer, a filter layer, and an output layer, as nodes. The method for generating the data processing sequence includes: (a) generating a plurality of individuals in which a plurality of genes for expressing one of a type of the input layer and the filter layer, and a parameter set for the filter layer, are sequenced, and thus generating a population of one generation; (b) allocating one of the input layer, which is one of the nodes, the filter layer, which is another one of the nodes, and the parameter, to each of the genes forming the individual, with reference to a reference table establishing a correspondence between the gene, and the node and the parameter, and thus generating the data processing sequence corresponding to the individual; (c) performing data processing of subject data for each of a plurality of the data processing sequences expressed by the population, then comparing output data outputted for each of the data processing sequences, and target data to be a target associated with the subject data, and calculating an evaluation value indicating a degree of similarity between the output data and the target data; and (d) specifying the data processing sequence that satisfies a predetermined criterion, using a plurality of the evaluation values corresponding to the plurality of the data processing sequences, respectively.
According to a second aspect of the present disclosure, a device for generating a data processing sequence is provided. The data processing sequence has an input layer, a filter layer, and an output layer, as nodes. The device for generating the data processing sequence includes: a population generating unit that generates a plurality of individuals in which a plurality of genes for expressing one of a type of the input layer and the filter layer, and a parameter set for the filter layer, are sequenced, and thus generates a population of one generation; a gene translation unit that allocates one of the input layer, which is one of the nodes, the filter layer, which is another one of the nodes, and the parameter, to each of the genes forming the individual, with reference to a reference table establishing a correspondence between the gene, and the node and the parameter, and thus generates the data processing sequence corresponding to the individual; a calculation unit that performs data processing of subject data for each of a plurality of the data processing sequences expressed by the population, then compares output data outputted for each of the data processing sequences, and target data to be a target associated with the subject data, and calculates an evaluation value indicating a degree of similarity between the output data and the target data; and a specifying unit that specifies the data processing sequence that satisfies a predetermined criterion, using a plurality of the evaluation values corresponding to the plurality of the data processing sequences, respectively.
According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium storing a computer program for causing a computer to execute generation of a data processing sequence is provided. The data processing sequence has an input layer, a filter layer, and an output layer, as nodes. The computer program includes: (a) a function of generating a plurality of individuals in which a plurality of genes for expressing one of a type of the input layer and the filter layer, and a parameter set for the filter layer, are sequenced, and thus generating a population of one generation; (b) a function of allocating one of the input layer, which is one of the nodes, the filter layer, which is another one of the nodes, and the parameter, to each of the genes forming the individual, with reference to a reference table establishing a correspondence between the gene, and the node and the parameter, and thus generating the data processing sequence corresponding to the individual; (c) a function of performing data processing of subject data for each of a plurality of the data processing sequences expressed by the population, then comparing output data outputted for each of the data processing sequences, and target data to be a target associated with the subject data, and calculating an evaluation value indicating a degree of similarity between the output data and the target data; and (d) a function of specifying the data processing sequence that satisfies a predetermined criterion, using a plurality of the evaluation values corresponding to the plurality of the data processing sequences, respectively.
A-1. Configuration of Generating System
The generating device 20 has a sequence generating function of generating a specified data processing sequence DSq to acquire desired target data TM after data processing, a coupling condition generating function of generating a coupling condition table 88 used to execute the sequence generating function, and a data processing function. The target data TM is prepared in advance according to the purpose of data processing based on the data processing sequence. For example, when the purpose is to determine the type of input data ID inputted to a data processing sequence Sq, the target data TM is data representing the result of determination. Also, for example, when a physical quantity such as a predetermined voltage or temperature is to be acquired from the input data ID, the target data TM is data representing a physical quantity. In this embodiment, the target data TM is a target image.
The data processing function is the function of performing data processing of the input data ID, using the data processing sequence Sq. The generating device 20 in this embodiment automatically generates the specified data processing sequence DSq to acquire a desired image to achieve a desired purpose, based on a picked-up image, which is the input data ID. For example, the generating device 20 performs image processing of an image of a circuit board as an industrial product picked up by the sensor device 200, using the specified data processing sequence DSq, and thus outputs a binary image showing a defective part as a black image and the other parts as a white image, as a desired image. For example, based on this binary image, a user or a device specifies whether there is a defective part or not, and the position of a defective part, if any. Thus, an inspection of the industrial product is performed.
The sequence generating function generates a plurality of data processing sequences Sq, using genetic programming, and specifies the specified data processing sequence DSq to acquire an image after desired image processing, from among the plurality of data processing sequences Sq that are generated.
The coupling condition generating function generates the coupling condition table 88 to determine which sequence element the numeric value of a gene arranged at a gene locus corresponds to. In this embodiment, the data processing function, the sequence generating function, and the coupling condition generating function are installed in the single generating device 20. However, this is not limiting. In another embodiment, the data processing function, the sequence generating function, and the coupling condition generating function may be separately installed in different devices or may be present on a cloud.
The generating device 20 is an electronic computer such as a personal computer. The generating device 20 has a processor 25, a storage device 70, an input unit 150, and a display unit 160. The processor 25 executes various programs stored in the storage device 70 and thus controls the operation of the generating device 20. Detailed functions of the processor 25 will be described later. The storage device 70 is formed of a memory such as a RAM or a ROM. In the storage device 70, various programs to implement various functions of the processor 25, and various data used to generate the data processing sequence Sq, are stored. Details of the storage device 70 will be described later. The input unit 150 is an interface that accepts information from outside. The input unit 150, for example, accepts an input of data of a picked-up image or the like from the sensor device 200 or accepts an input of data of an image or the like generated by the user using another device. The display unit 160 displays various information. The display unit 160 is, for example, a liquid crystal monitor.
The processor 25 executes various programs in the storage device 70 and thus functions as a sequence generating unit 30, a data processing unit 40, an evaluation determination unit 46, a coupling condition table generating unit 55, and a display control unit 60. A part of the functions executed by the processor 25 may be implemented by a hardware circuit. In the present disclosure, the “processor” is a term including a CPU and a GPU.
The sequence generating unit 30 structurally expresses a gene sequence represented by an individual IV like a tree structure and thus generates a sequence set formed of a plurality of data processing sequences Sq having different combinations of sequence elements. The data processing sequence Sq is expressed by a combination of a plurality of sequence elements. The sequence elements include: (i) an input layer, which is a node to input data; (ii) a filter layer to execute data processing, which is an intermediate node between an input layer and an output layer; (iii) an output layer, which is a node to output output data PM, which is data after final data processing; and (iv) a parameter of the data processing executed by the filter layer. The data processing sequence Sq includes at least one filter layer. The input layer is a starting-point node of the data processing sequence Sq. The output layer is an end-point node of the data processing sequence Sq.
The sequence generating unit 30 has a population generating unit 32, a gene translation unit 34, and a type table generating unit 36. The population generating unit 32 generates the individual IV formed of a plurality of genes that are sequenced one-dimensionally. Each gene forming the individual IV is a numeric value representing one of the type of the input layer and the filter layer, and the parameter value of each parameter of the filter layer, of the sequence elements. One of the input layer and the filter layer, or the parameter value of the parameter, is allocated for each numeric range of the gene that represents the range of occurrence. In this way, in this embodiment, the parameter set for the filter layer, too, is expressed by a gene. As described above, the individual IV is generated by sequencing genes corresponding to the sequence elements, respectively, except the output layer.
The population generating unit 32 generates a predetermined number of individuals IV for each one generation G. In this embodiment, the population generating unit 32 sequences genes one-dimensionally and thus generates the individual IV with a predetermined gene length. In each one generation G, the combination of sequence elements varies among the plurality of data processing sequences Sq. For the first generation G, the population generating unit 32 randomly arranges a numeric value up to the third place after the decimal point, of values from 0 to 1, as a gene at each gene locus of the individual IV, and thus generates a population 84 formed of a plurality of individuals IV. From the second generation G onward, the population generating unit 32 newly generates the individual IV, using at least one of the techniques of crossover and mutation from the individual IV with a high evaluation value EV, described later, of the individuals IV of the previous parent generation G, and thus generates the population 84 that is an aggregate of the newly generated individual IV and the individual IV maintained from the parent generation G, that is, the individual IV copied from the individual IV of the parent generation G.
The gene translation unit 34 refers to a gene table 82 and the coupling condition table 88, described later, which are stored in the storage device 70, and thus translates each gene of the individual IV and generates the data processing sequence Sq expressed as a tree structure. The gene table 82 and the coupling condition table 88 are tables prescribing sequence elements corresponding to each numeric range of a numeric value, which is a gene, and the coupling relationship between the sequence elements. The data processing sequence Sq is expressed by the individual IV and the gene table 82 or by the individual IV and the coupling condition table 88.
The type table generating unit 36 executes a type table generating process of generating a type table 92 that prescribes the type of a sequence element represented by each gene of the individual IV, for each gene. The type table 92 is used to generate the individual IV generated to specify the specified data processing sequence DSq by the sequence generating function. The type table 92 is a table that prescribes a decoding type, which is the type of a sequence element represented by each gene of the individual IV, for each gene. The type table 92 prescribes the decoding type in association with all the gene locus numbers that the individual IV has, in this embodiment, 15 gene locus numbers. In this way, the type table generating process generates the type table 92 where the decoding type for distinguishing the node represented by the gene and the parameter is associated with each gene forming the individual IV from which the data processing sequence Sq is generated. Details of the type table 92 will be described later.
The data processing unit 40 performs data processing of the input data ID inputted to the input layer and outputs the output data PM after data processing from the output layer, using the data processing sequence Sq generated by the gene translation unit 34 and the specified data processing sequence DSq stored in the storage device 70.
The evaluation determination unit 46 specifies the specified data processing sequence DSq that satisfies a predetermined criterion, from among a plurality of data processing sequences Sq represented by a plurality of individuals IV of one generation G. The evaluation determination unit 46 has a calculation unit 47 and a specifying unit 49.
The calculation unit 47 compares the output data PM after data processing acquired by data processing of learning data LM, which is an example of the input data ID, based on the data processing sequence Sq represented by the individual IV, with the target data TM, which is a target associated with the learning data LM, and thus calculates the evaluation value EV indicating a degree of similarity SD between the output data PM and the target data TM. The calculation unit 47 calculates the evaluation value EV for each of a plurality of data processing sequences Sq represented by a plurality of individuals IV of one generation G. The calculated evaluation value EV is stored in association with the individual IV in the storage device 70.
The specifying unit 49 determines whether the data processing sequence Sq satisfies a predetermined criterion or not, using the calculated evaluation value EV, and specifies the data processing sequence Sq that satisfies the criterion, as the specified data processing sequence DSq.
As the evaluation value EV, for example, one of the mean squared error (MSE), the peak signal-to-noise ratio (PSNR), and the structural similarity (SSIM) can be used. When the MSE is used as the evaluation value EV, a smaller MSE value means a higher degree of similarity SD between the output data PM and the target data TM. That is, the reciprocal of the MSE represents the degree of similarity SD. When the PSNR is used as the evaluation value EV, a greater PSNR value means a higher degree of similarity SD between the output data PM and the target data TM. That is, the PSNR represents the degree of similarity SD. When the SSIM is used, for example, data such as image data is divided into sub-areas and the MSSIM (mean SSIM), which is the average value of the SSIMs calculated for the sub-areas, respectively, is used as the evaluation value EV. When the MSSIM is used as the evaluation value EV, a greater MSSIM value means a higher degree of similarity SD. That is, the MSSIM represents the degree of similarity SD. With respect to the evaluation value EV, when the output data PM and the target data TM indicate a result of determination such as whether the input data ID is a good product or a defective product, the degree of similarity SD may be, for example, the rate of coincidence between the output data PM and the target data TM corresponding to a plurality of input data ID.
The coupling condition table generating unit 55 generates the coupling condition table 88, using the evaluation value EV calculated by the evaluation determination unit 46 and the individual IV associated with the evaluation value EV. The coupling condition table 88 is a table that prescribes a coupling reference value RV indicating the suitability of the coupling of sequence elements to output desired data, using the target data TM as a target. Specifically, the coupling condition table 88 is a table that prescribes the coupling reference value RV for each element set, which is a pair of node elements made up of an input-side node element and an output-side node element coupled together. The coupling reference value RV represents the probability of occurrence of an element set of a pair of node elements as component elements of the data processing sequence Sq. The greater coupling reference value RV means a higher probability of occurrence of a corresponding element set. A method for generating the coupling condition table 88 will be described later.
The display control unit 60 causes the display unit 160 to display various information. The display control unit 60 causes the display unit 160 to display, for example, the specified data processing sequence DSq, the output data PM, the target data TM, and the evaluation value EV.
The various condition table 93 prescribes conditions for various processing to be executed by the generating device 20. For example, the various condition table 93 prescribes an end condition used when executing the generation processing for the coupling condition table 88, a reference condition to specify the specified data processing sequence DSq, and a generation condition used when generating a population of a next generation. The specified data processing sequence DSq is the data processing sequence Sq determined as satisfying the predetermined criterion by the specifying unit 49. The specified data processing sequence DSq is represented, for example, by layer identifiers that identify a plurality of filter layers, which are a plurality of data processing layers, and the order of the layer identifiers, that is, the coupling relationship. The various program 94 is a program executed by the processor 25.
The node element group 80 shown in
The gene table 82 is a table showing the coupling relationship between candidate sequence elements of the data processing sequence Sq and the correspondence to sequence elements corresponding to numeric values expressed by genes.
The second-type gene table 82B shows the correspondence between a parameter value and the numeric value VG expressed by a gene, when a parameter is set for the filter layer. The second-type gene table 82B is provided for each filter layer for which a parameter can be set. For example, for the filter layer FtG, two types of parameters FtG_P1, FtG_P2 can be set. Therefore, a second-type gene table 82B1 prescribes one parameter FtG_P1 and a second-type gene table 82B2 prescribes the other parameter FtG_P2.
The first-type gene table 82A prescribes the number of inputs, the number of parameters, and the range of occurrence, for each node element type representing the type of the input layer and the filter layer. The node element type is an identifier that identifies the input layer and the filter layer. The number of inputs represents the number of sequence elements coupled to the input side of the filter layer and the input layer. When the number of inputs is “2”, data outputted from two nodes are inputted to the filter layer. In this embodiment, the numbers of nodes coupled to the output side of each node are all “1”, and the filter layer and the input layer are coupled to one output-side node.
The second-type gene table 82B prescribes the relationship between the parameter value and the range of occurrence, for each node element type for which the parameter is set.
The range of occurrence in the first-type gene table 82A and the second-type gene table 82B prescribes the range of the numeric value VG of a gene. For example, in the first-type gene table 82A, when the numeric value VG of a gene is equal to or greater than 0 and smaller than 0.143, the input layer in is allocated to this gene. In this embodiment, in the gene tables 82A, 82B1, 82B2 and so on, the numeric values of 0 to 1 are equally divided to set ranges of occurrence in each table so that the node element type or the parameter value randomly occurs in the data processing sequence Sq with an equal probability.
The population 84 shown in
Before a further description referring to
In this embodiment, the generation processing for the data processing sequence Sq by the gene translation unit 34 includes two types, that is, prior generation processing and specified generation processing. The prior generation processing is processing executed to execute the coupling condition generating function and thus generate the coupling condition table 88. The specified generation processing is processing executed when the sequence generating function using the coupling condition table 88 is executed. The gene translation unit 34 of the sequence generating unit 30 generates the data processing sequence Sq, referring to the gene table 82 shown in
In the prior generation processing, the gene translation unit 34 generates the tree-structured data processing sequence Sq in order from the side of the output layer out, using the individual IV, the gene table 82, and the node element group 80. As shown on the right side in
The gene translation unit 34 refers to the numeric value VG “0.899” of the gene of No.1 of the individual IV1, and the first-type gene table 82A shown in
Next, referring to the first-type gene table 82A, the gene translation unit 34 sets a reservation code in a table-formatted data processing sequence TSq1 according to the number of inputs and the number of parameters of the filter layer FtL set for node No. 1. Specifically, the number of parameters of the filter layer FtL set for node No.1 is “1” and the number of inputs is “2”. Therefore, the gene translation unit 34 sets a reservation code for a filter parameter 1, a first input-side node number, and a second input-side node number corresponding to node No.1 in the table-formatted data processing sequence TSq.
Next, the gene translation unit 34 sets a parameter for the reservation code set for the filter parameter, of the set reservation codes. Specifically, the gene translation unit 34 selects a parameter value used for the filter layer FtL, referring to the second-type gene table 82B corresponding to the filter layer FtL of node No.1, and a numeric value VG2 of the gene of gene locus No. 2. By referring to the numeric value VG2 of the gene of gene locus No.2 and the second-type gene table 82B, the gene translation unit 34 sets a parameter value TL1 for the filter layer FtL, as shown in the middle part of
For the filter layer FtL set for node No.1, the gene translation unit 34 sets the input-side node after finishing the setting of the parameter. Specifically, the gene translation unit 34 sets a node, giving priority to the first input-side node, of the first input-side node and the second input-side node, until the first input-side node becomes the input layer in or the input layer ConB, which is the starting-point node. In the example shown in
As the input layer ConB, which is the starting-point node, is set for the first input-side node of the filter layer FtL, the gene translation unit 34 then sets the second input-side node, for which the reservation code of node No.1 is set. The gene translation unit 34 sets a sequence element, referring to the numeric value VG of a gene at a gene locus and the gene table 82, until all the input sides become the input layer in or the input layer ConB.
When all the input-side nodes have become one of the input layer in and the input layer ConB, the gene translation unit 34 ends the generation processing for the data processing sequence Sq using the prior generation processing, even if not all the genes of the individual IV1 are used. In the case where all the genes of the individual IV1 are used, when not all the input-side nodes have become the input layer in or the input layer ConB, the gene translation unit 34 sets a predetermined input layer, in this embodiment, the input layer in, for the input-side node that is left yet to be coupled, and thus ends the generation processing for the data processing sequence Sq.
The storage device 70 will be described further, using
As shown in
In step S101, the storage device 70 stores the learning data group 74 formed of a plurality of learning sets SM. Step S101 is executed by the user inputting the learning data group 74 to the generating device 20.
In step S102, the coupling condition table generating unit 55 initializes the coupling condition table 88. Specifically, the coupling condition table generating unit 55 sets all the average values ARV, which are the values of individual element sets in the coupling condition table 88, to be predetermined value, as shown in
Next, as shown in
Next, as shown in
Next, in step S109, the calculation unit 47 of the evaluation determination unit 46 compares the plurality of output data PM generated in step S105 with the target data TM associated with the learning data LM from which each of the plurality of output data PM is generated, and calculates a plurality of evaluation values EV, and thus evaluates the result of the processing. The calculation unit 47 uses the average value of the plurality of evaluation values EV, as the final evaluation value EV indicating the degree of similarity SD. In step S109, the evaluation determination unit 46 calculates the coupling reference value RV, using the final evaluation value EV. In this embodiment, the evaluation determination unit 46 uses the degree of similarity SD for the coupling reference value RV. That is, when the final evaluation value EV is the mean squared error, the coupling reference value RV is the reciprocal of the evaluation value EV. When the PSNR, the MSE, or the SSIM is used as the final evaluation value EV, the value of the evaluation value EV is used as the coupling reference value RV.
Next, in step S110, the coupling condition table generating unit 55 executes the update of the coupling condition table 88. For example, when the coupling reference value RV calculated from the final evaluation value EV of the data processing sequence Sq1 shown in
RVn is the coupling reference value added at the n-th time. ARVn-1 is the average value prescribed in the field of the element set up to the previous time.
When the data processing sequence Sq1 includes a plurality of the same element sets, the coupling reference value RV may be added by the number of the same element sets or the coupling reference value RV may be added only once. In this embodiment, even when the one data processing sequence Sq1 includes a plurality of the same element sets, the coupling reference value RV is added only once. When the element set of the input-side node element and the output-side node element is expressed as [input-side node element, output-side node element], the data processing sequence Sq1 shown in
[input side=input layer in,output side=filter layer FtI]
[input side=filter layer FtI,output side=filter layer FtG]
[input side=filter layer FtG,output side=filter layer FtL]
[input side=input layer ConB,output side=filter layer FtL]
[input side=filter layer FtL,output side=output layer out]
As shown in
Meanwhile, when the result of the determination in step S111 is “Yes”, the coupling condition table generating unit 55 in step S113 determines whether an end condition is satisfied or not. The end condition is a condition that the processing routine of steps S103 to S111 is executed a predetermined prior number of times. The predetermined prior number of times is set, for example, to be such a number of times that the coupling reference value RV is added at least once, preferably twice or more, to all the fields of element sets in the coupling condition table 88. For example, the prior number of times is set in such a way that the processing routine of steps S104 to S111 is executed for individuals IV that are twice the number of element sets prescribed in the coupling condition table 88 or more.
As described above, the coupling condition table 88 is generated by using the degree of similarity SD generated using each of a plurality of data processing sequences Sq generated by the processing of step S104, for the coupling reference value RV, in such a way that node elements occur with a random probability. Thus, as the individual IV is generated using the coupling condition table 88, the probability that an element set with high suitability of coupling is included in the data processing sequence Sq can be increased.
When the end condition is not satisfied, the population generating unit 32 executes step S103 again in the next processing routine. Step S103 that is executed again is executed by replacing an individual IVm whose degree of similarity SD is at up to the J-th place from the bottom, of individuals IVm1 to IVm5 of a parent generation Gm generated in step S103 in the previous processing routine, with a new individual IVn. “J” is an integer equal to or greater than 1. That is, the population generating unit 32 copies the individual IV whose degree of similarity SD is not at up to the J-th place from the bottom. The population generating unit 32 performs at least one of crossover and mutation from an individual IV whose degree of similarity SD is not at up to the J-th place from the bottom, and thus generates a new individual IV. Thus, a new data processing sequence Sq having a different combination of sequence elements from the data processing sequence Sq generated up to the previous time can be easily generated. The processing from step S104 onward is executed again on the individual IVn generated by step S103 that is executed again.
Meanwhile, when the end condition is satisfied, the coupling condition table generating unit 55 in step S115 outputs the coupling condition table 88 as of when the end condition is satisfied, and thus causes the storage device 70 to store this coupling condition table 88.
In step S301, the storage device 70 stores the learning data group 74 formed of a plurality of learning sets SM. Step S301 is executed by the user inputting the learning data group 74 to the generating device 20. When the generation processing for the specified data processing sequence DSq is executed by the same device as the generating device 20 executing the generation processing for the coupling condition table 88 and the same learning data group 74 is used, the learning data group 74 is already stored in the storage device 70 and therefore step S301 can be omitted. Meanwhile, for example, when the learning data group 74 is generated based on a circuit board that is the same type as the circuit board which is the subject product from which the learning data group 74 used in the generation processing for the coupling condition table 88 is generated but that is produced, for example, in a different plant, or when the product from which the learning data group 74 is generated is different though the purpose of inspecting whether there is the defective part DA or not is the same, step S301 is executed.
In step S304, the storage device 70 stores the coupling condition table 88 generated in the generation processing for the coupling condition table 88. When the generation processing for the specified data processing sequence DSq is executed by the same device as the generating device 20 executing the generation processing for the coupling condition table 88, the coupling condition table 88 is already stored in the storage device 70. Therefore, in this case, step S304 can be omitted. The order of steps S300 to S304 is not limited to the foregoing order.
Next, in step S306, the population generating unit 32 generates a plurality of individuals IV and thus generates the population 84 of one generation. As described above, the individual IV is made up of a plurality of genes sequenced, each gene representing one of the type of the input layer and the filter layer, and the parameter set for the filter layer, as shown in
Next, in step S308, the gene translation unit 34 selects one of the individuals IV1 to IV5, translates the selected one individual IV with reference to the second-type gene table 82B and the reference table 89 including the coupling condition table 88, and thus generates the data processing sequence Sq. That is, in step S308, the gene translation unit 34 allocates one of the input layer, which is one node, the filter layer, which is another node, and the parameter, to each gene forming the individual IV, with reference to the reference table 89 establishing the correspondence between the genes of the individual IV, and the nodes and the parameter, and thus generates the data processing sequence Sq corresponding to the individual IV. The generation of the data processing sequence Sq in step S308 is executed by the foregoing specified generation processing. Details of step S308 will be described later.
Next, in step S350, the data processing unit 40 performs data processing of a plurality of learning data LM, using the data processing sequence Sq generated in step S308, and thus generates a plurality of output data PM.
Next, in step S352, the evaluation determination unit 46 compares the plurality of output data PM generated in step S350 with the target data TM associated with the learning data LM from which each of the plurality of output data PM is generated, and calculates a plurality of evaluation values EV, and thus evaluates the result of the processing. The evaluation determination unit 46 uses the average value of the plurality of evaluation values EV that are calculated, as the final evaluation value EV indicating the degree of similarity SD between the output data PM and the target data TM.
Next, in step S354, the evaluation determination unit 46 determines whether the processing of steps S308 to S352 is executed for all the individuals IV of the one generation G or not. When the result of the determination in step S354 is “No”, the processor 25 selects one of the individuals IV for which the processing of steps S308 to S352 is not executed, of the individuals IV of the one generation G, and executes the processing of steps S308 to S352 again. That is, the data processing unit 40 performs data processing of the learning data LM, based on each of the plurality of data processing sequences Sq corresponding to the plurality of individuals IV forming the one generation G, and thus generates the output data PM for each of the plurality of data processing sequences Sq. The evaluation determination unit 46 then compares the plurality of output data PM generated for each of the plurality of data processing sequences Sq with the corresponding target data TM and thus calculates the evaluation value EV.
Meanwhile, when the result of the determination in step S354 is “Yes”, the specifying unit 49 of the evaluation determination unit 46 in step S356 determines whether there is a data processing sequence Sq that satisfies a predetermined criterion or not, using the plurality of evaluation values EV calculated for the current generation. Specifically, the specifying unit 49 of the evaluation determination unit 46 determines that there is a data processing sequence Sq that satisfies the criterion, when a highest degree of similarity SDmax, of the degrees of similarity SD indicated respectively by the plurality of evaluation values EV calculated based on the plurality of individuals IV of the current generation, is equal to or higher than a predetermined end threshold. That is, the process of step S356 is a process of specifying a data processing sequence Sq that satisfies the predetermined criterion, using the plurality of evaluation values EV corresponding respectively to the plurality of data processing sequences Sq.
When there is a data processing sequence Sq that satisfies the criterion, the specifying unit 49 of the evaluation determination unit 46 in step S358 outputs the data processing sequence Sq that satisfies the criterion, as the specified data processing sequence DSq. The outputted specified data processing sequence DSq is stored in the storage device 70.
Meanwhile, when there is no data processing sequence Sq that satisfies the criterion, the processing of steps S306 to S356 is executed as the next routine. That is, in step S306 in the next routine, the population 84 of the next generation is generated by a next generation generating process. In the next generation generating process, the population generating unit 32 replaces a subject data processing sequence Sq that is a data processing sequences Sq where one or more of the plurality of individuals IV generated in the previous routine have a low degree of similarity SD indicated by the evaluation value EV, with a new data processing sequence Sq having different sequence elements, and thus generates a sequence set. In this embodiment, the population generating unit 32 performs at least one of crossover and mutation from an individual IV whose degree of similarity SD is not at up to the J-th place from the bottom and is therefore high, of the plurality of individuals IV of the parent generation used in the previous routine, and thus replaces an individual IV whose degree of similarity SD is low, that is, at up to the J-th place from the bottom, with a new individual IV. In the next generation generating process, the population generating unit 32 copies the individual IV whose degree of similarity SD is not at up to the J-th place from the bottom and is therefore high. A new sequence set is formed of the copied individual IV and the individual IV newly generated using crossover or mutation. Then, the processing of steps S308 to S356 is executed again on the new sequence set. Since one or more individuals IV with a low degree of similarity SD are replaced with a new individual IV based on an individual IV with a high degree of similarity SD, as described above, the data processing sequence Sq with a low degree of similarity SD can be eliminated from the processing subjects. Thus, the data processing sequence Sq that satisfies the criterion can be specified more efficiently.
The next generation generating process includes a reference individual generating process of performing at least one of crossover and mutation with reference to the type table 92 shown in
In the processing of steps S308 to S356 executed on the new sequence set, the evaluation value EV calculated in the previous routine or before is used for the same data processing sequence Sq as the data processing sequence Sq forming the sequence set used in the previous routine or before. Thus, the evaluation value EV need not be calculated again and therefore the processing efficiency of the specified data processing sequence generation processing can be improved.
As shown in
When executing processing related to the generation of a sequence element of the data processing sequence Sq such as selecting an input-side node element or acquiring the number of parameters in the processing from step S316 onward, the sequence generating unit 30 updates the table-formatted data processing sequence TSq shown in
In step S311, the gene translation unit 34 selects an unprocessed one of the individuals IV1 to IV5 forming the current generation G stored in the storage device 70. A case where the individual IV2 shown in
Next, in step S316, the gene translation unit 34 selects one uncoupled output-side node element to which an input-side node element is not coupled according to a coupling rule. In this embodiment, the data processing sequence Sq is generated in order from the output side to the input side, as shown in
Following step S316, the gene translation unit 34 in step S318 determines an input-side node to be coupled to the output-side node, which is a coupling point, based on the coupling condition table 88 and the genes of the selected individual IV. Specifically, the gene translation unit 34 generates the data processing sequence Sq in such a way as to achieve a relationship of probability such that the probability of coupling to the output-side node is higher for an input-side node having a higher average value ARV as the coupling reference value RV in relation to the output-side node, using the coupling condition table 88. The data processing sequence Sq having the above relationship of probability is generated by the selection of an input-side node element in relation to an output-side node element according to a node selection algorithm given below.
The preconditions of the node selection algorithm are as follows.
VG is the numeric value of a gene. VG is a numeric value up to the third place after the decimal point, of values from 0 to 1.
j is the identifier of an output-side node element. j is expressed by an integer equal to or greater than 0. A different value is allocated from one output-side node element to another. In this embodiment, as the identifier j, 0 to 6 are allocated in the order of the output-side node elements FtG to out.
i is the identifier of an input-side node element to be coupled. i is expressed by an integer equal to or greater than 0 and expressed as an identifier of 0 to Nf−1. Nf is the number of candidates for the input-side node element. In this embodiment, the number of input-side node elements Nf is 8, as shown in
tij is the value of an element set in the coupling condition table 88. tij is the average value ARV shown in
In the node selection algorithm, a probability Pij that the input-side node element i is coupled to the input side of the output-side node element j is calculated by an equation (1) given below.
In the node selection algorithm, an upper threshold Tij of the numeric range of the gene where the input-side node element i is coupled to the output-side node element j is calculated, using an equation (2) given below. A lower threshold is set to be the upper threshold of the input-side node element corresponding to the immediately previous identifier. When there is no immediately previous identifier, the lower threshold is set to be 0.
As the numeric range representing the range of occurrence of the gene is determined using the above node selection algorithm, the data processing sequence Sq is generated in such a way that the ratio of the average values ARV, which are the coupling reference values of the input-side node elements that are candidates to be coupled to the same output-side node element is the ratio of the probabilities of coupling to the output-side node element.
In this embodiment, the gene translation unit 34 selects an input-side node element in the following manner according to the value VG of the gene, using the node selection algorithm. An inequality sign may be changed to include or exclude an equality sign as long as the value VG of the gene is included in one of the ranges of occurrence. That is, the gene translation unit 34 selects:
the input layer in, which is the input-side node element No.0, when 0≤VG<T0j;
the input layer ConB, which is the input-side node element No. 1, when T0j≤VG≤Tij;
the filter layer FtG, which is the input-side node element No. 2, when Tij<VG≤T2j;
the filter layer FtH, which is the input-side node element No. 3, when T2j<VG≤T3j;
the filter layer FtI, which is the input-side node element No. 4, when T3j<VG≤T4j;
the filter layer FtJ, which is the input-side node element No. 5, when T4j<VG≤T5j;
the filter layer FtK, which is the input-side node element No. 6, when T5j<VG≤T6j; and
the filter layer FtL, which is the input-side node element No. 7, when T6j<VG≤T7j.
The threshold table 98 shown in
In step S318 shown in
As shown in
In step S322 following step S320, the gene translation unit 34 acquires the number of parameters and the number of inputs of the input-side node element selected in step S318, referring to the coupling condition table 88. In step S322, the gene translation unit 34 sets a reservation code in the table-formatted data processing sequence TSq2 shown in
As shown in
In step S326 shown in
Next, in step S328, the type table generating unit 36 associates an identifier identifying that it is a parameter, with a gene locus number where a corresponding gene is arranged, and thus records the identifier in the type table 92. In this embodiment, the type table generating unit 36 records an identifier “Param” indicating a parameter as a decoding type in association with gene locus No.2 where the corresponding gene that is the source of translation is arranged, in the type table 92, as shown in the second illustration from the left in
As shown in
When it is determined that an uncoupled node exists, the gene translation unit 34 executes step S316 again. In the example shown in
Meanwhile, when the gene translation unit 34 has determined that there is no uncoupled node, the type table generating unit 36 in step S332 associates an unused identifier that is not used for the translation with a gene locus where a corresponding gene is arranged, and thus records the identifier in the type table 92. For example, in the generation of the data processing sequence Sq2 using the individual IV2, the genes of gene locus Nos. 8 to 15 are not used for the translation and therefore an identifier “Empty” is recorded for gene locus Nos. 8 to 15, as shown in the type table 92 on the right side in
As shown in
When there is an uncoupled node or an unconfirmed parameter even if all the genes of the individual IV are used, the sequence generating unit 30 executes end processing, describe below. In the end processing, when there is an uncoupled node, the gene translation unit 34 sets all the input layers in for the uncoupled node. In the end processing, when there is an unconfirmed parameter, the gene translation unit 34 sets a predetermined specified parameter. In the end processing, when an uncoupled node or an unconfirmed parameter is set, there is no gene of the source of translation and therefore the recording of a type code in the type table 92 is not executed.
Details of step S306 executed from the second routine onward in the flowchart shown in
In the reference individual generating process, when generating the individual IV by mutation, the population generating unit 32 performs mutation of a specified gene associated with the parameter as the decoding type, of a plurality of genes of the individual IV that is a subject of mutation. In the type-referenced crossover process, when generating the individual IV by crossover, for example, by single-point crossover, the population generating unit 32 sets a crossover point between the specified gene and the next gene, of a plurality of genes of one of the individuals IV from which the new individual IV is generated, and crossover is thus performed. The type-referenced mutation process will now be described, using an illustration.
The population generating unit 32 also executes the type-referenced mutation process for the individual IVm1 of the parent generation with the highest degree of similarity SD and thus generates an individual IVn4 of the current generation Gn. Specifically, the population generating unit 32 specifies a gene locus associated with the identifier “Param” as the decoding type with reference to the type table 92. In this embodiment, the identifier “Param” is associated with gene locus No.2. In this case, the population generating unit 32 performs the mutation of the gene of gene locus No.2 of the individual IVm1 of the parent generation Gm and thus generates the individual IVn4 of the current generation Gn.
The population generating unit 32 sets an arbitrary position as a crossover point for the individual IVm2 and the individual IVm3 of the parent generation Gm without referring to the type table 92 and executes crossover, and thus generates the individual IVn5 of the current generation Gn.
Next, in step S501, the storage device 70 stores the specified data processing sequence DSq specified in step S358 in
Next, in step S503, the data processing unit 40 reads out and thus acquires data that is stored in the storage device 70 via the input unit 150 and that is a subject of data processing of the specified data processing sequence DSq. The data acquired in step S503 is, for example, data of the same type as the learning data LM, and in this embodiment, a picked-up image of a subject. When there are a plurality of data to be a subject of data processing, the data processing unit 40 may read out one of the plurality of data stored in advance in the storage device 70 and thus may acquire the data, or may acquire data to be a subject each time from the sensor device 200 at the timing of executing data processing, described later.
Next, in step S504, the data processing unit 40 executes data processing using the specified data processing sequence DSq, on the data acquired in step S503. That is, data processing is executed on the image that is the data, according to the order and the parameter value represented by the specified data processing sequence DSq.
Next, in step S505, the output data PM, which is the data after the data processing using the specified data processing sequence DSq, is outputted. Step S505 is executed, for example, as the output data PM is stored in the storage device 70 or displayed on the display unit 160.
Next, in step S506, the data processing unit 40 determines whether to continue the data processing using the specified data processing sequence DSq or not. For example, when information indicating the continuation of the data processing is inputted by the user or when unprocessed data to be a subject of the data processing is left in the storage device 70, the data processing unit 40 determines that the data processing is to be continued. When continuing the data processing, the processing from step S503 onward is executed again. Meanwhile, when information indicating the end of the data processing is inputted by the user or when unprocessed data to be a target of the data processing is not left in the storage device 70, the data processing unit 40 ends the use processing process.
According to the foregoing embodiment, the genes forming the individual IV represent the parameter that is set for the filter layer in addition to the nodes of the input layer in and the filter layer, as shown in
According to the foregoing embodiment, in the next generation generating process, at least one of the reference individual generating process and the normal individual generating process is executed, based on the predetermined generation condition. Thus, setting the generation condition for the generation of the data processing sequence Sq to be a candidate for the specified data processing sequence DSq that satisfies the criterion enables the generation of the data processing sequence generated while paying attention to the parameter and the generation of the data processing sequence Sq generated without paying attention to the parameter. That is, setting the generation condition enables the optimization of the data processing sequence Sq by adjusting the parameter, and the optimization of the data processing sequence Sq by generating various data processing sequences.
In the foregoing embodiment, the range of occurrence in the second-type gene table 82B is set for each parameter in such a way that a plurality of parameter values occur evenly, as shown in
In the foregoing embodiment, the gene translation unit 34 determines the parameter of the filter layer each time, referring to the second-type gene table 82B and the value VG of the gene that is the source of translation, as in step S326 shown in
The present disclosure is not limited to the foregoing embodiment and can be implemented according to various aspects without departing from the spirit and scope of the present disclosure. For example, the present disclosure can be implemented according to the aspects given below. A technical feature in the foregoing embodiment corresponding to a technical feature in the aspects described below can be replaced or combined where appropriate in order to solve a part or all of the problems of the present disclosure or in order to achieve a part or all of the effects of the present disclosure. Such a technical feature can be deleted where appropriate unless described as essential in the specification.
The present disclosure can be implemented according to various other aspects than the above aspects. For example, the present disclosure can be implemented in the form of a non-transitory storage medium storing a computer program.
| Number | Date | Country | Kind |
|---|---|---|---|
| 2023-056834 | Mar 2023 | JP | national |