A method for training a machine learning model, a training apparatus, a printing apparatus, a program, and a method for manufacturing a printing apparatus.

The method enhances nail contour recognition in machine learning models by calculating and penalizing contour displacement, resulting in improved accuracy for nail printing.

JP7882068B2Active Publication Date: 2026-06-30CASIO COMPUTER CO LTD

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
CASIO COMPUTER CO LTD
Filing Date
2022-09-20
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Conventional machine learning models struggle to accurately eliminate minute deviations in nail contour recognition during image processing, leading to misalignment in nail printing.

Method used

A method for training a machine learning model that includes acquiring finger images with teacher data, inputting these images into the model, calculating the difference between actual and predicted contour positions, and adjusting the model using a loss function that penalizes displacement between contour points, thereby improving contour accuracy.

Benefits of technology

The trained model achieves higher accuracy in identifying nail contours, enabling precise nail printing by accurately specifying the contour positions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007882068000001
    Figure 0007882068000001
  • Figure 0007882068000002
    Figure 0007882068000002
  • Figure 0007882068000003
    Figure 0007882068000003
Patent Text Reader

Abstract

To provide a machine learning model learning method, a learned model, a learning device, a printing apparatus, a program, and a printing apparatus manufacturing method in which the outline of a nail can be identified with high precision.SOLUTION: A machine learning model learning method includes a first acquisition step of acquiring a finger image including a nail, and teacher data indicating a first outline position of the nail in the finger image, a second acquisition step of acquiring information regarding a nail region that is outputted from a machine learning model in response to an input of the finger image to the machine learning model, and a comparison adjustment step of obtaining a loss corresponding to displacement of the first outline position from a second outline position in the acquired nail region, and feeds back the loss to the machine learning model. A loss function for obtaining the loss is determined in such a way that a magnitude corresponding to the displacement amount between each point in the first outline position and the corresponding point in the second outline position is included in the loss.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for training a machine learning model 、 a training device, a printing device, a program, and a method for manufacturing a printing device.

Background Art

[0002] There is a technique for printing patterns on nails, nail seals, nail tips, etc. attached to nails. In order to accurately print on the nail by aligning the position and range, it is necessary to accurately recognize the shape of the nail. The shape of the nail can be obtained by performing image recognition processing for recognizing the nail on a captured image including the nail. In image recognition processing, in recent years, a machine learning model has been used (Patent Document 1).

Prior Art Documents

Patent Documents

[0003]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] However, in the image recognition processing using the conventional machine learning model related to region division, there is a problem that it is difficult to appropriately eliminate a minute deviation of the contour of the nail.

[0005] An object of the present invention is to provide a method for training a machine learning model capable of more accurately specifying the contour of a nail 、 a training device, a printing device, a program, and a method for manufacturing a printing device.

Means for Solving the Problems

[0006] To achieve the above object, the present invention a first acquisition step of acquiring a finger image including a nail and teacher data indicating a first contour position of the nail in the finger image, A second acquisition step involves inputting the aforementioned finger image into a machine learning model and obtaining information related to the nail region output from the machine learning model. A comparison and adjustment step which involves calculating a loss corresponding to the difference between the first contour position and the acquired second contour position of the claw region and feeding this loss back to the machine learning model, Includes, The loss function used to calculate the loss is defined such that the loss includes an amount corresponding to the displacement between each point of the first contour position and each point of the second contour position. This is a method for training machine learning models. [Effects of the Invention]

[0007] According to the present invention, it is possible to obtain a trained model that can identify the contour of the nail with greater accuracy. [Brief explanation of the drawing]

[0008] [Figure 1] This is a block diagram showing the functional configuration of an information processing device. [Figure 2] This diagram illustrates the detection error of the nail contour. [Figure 3] This diagram illustrates the calculation of the displacement for each contour position. [Figure 4] This flowchart shows the control procedure for the learning control process. [Figure 5] This flowchart shows the control procedure for the loss value calculation process. [Figure 6] This diagram illustrates an example of setting the weighting range. [Modes for carrying out the invention]

[0009] Hereinafter, embodiments of the present invention will be described based on the drawings. Figure 1 is a block diagram showing the functional configuration of the information processing device 1 of this embodiment.

[0010] The information processing device 1, which is the learning device in this embodiment, may be a general-purpose PC (Personal Computer). The information processing device 1 includes a CPU 11 (Central Processing Unit) (processing unit), RAM 12 (Random Access Memory), storage unit 13, communication unit 14, display unit 15, operation reception unit 16, and the like.

[0011] The CPU 11 is a processor that performs arithmetic processing and provides overall control over the operation of the information processing device 1. The CPU 11 may consist of a single processor, or multiple processors may perform processing in parallel or independently depending on the application.

[0012] RAM12 provides the CPU11 with a working memory space and stores temporary data. RAM12 is, for example, DRAM, but is not limited to this.

[0013] The memory unit 13 is a non-volatile memory that stores the program 131 and various setting data. The non-volatile memory may include an HDD (Hard Disk Drive). The memory unit 13 may be an external device attached to the information processing device as a peripheral device. Alternatively, the memory unit 13 may be a network storage device or a cloud server located on a network. The memory unit 13 also stores a machine learning model 132 related to image recognition of fingernail contours and its training data 133.

[0014] The communication unit 14 transmits and receives data with external devices in accordance with communication standards. Communication standards include various standards such as TCP / IP related to LANs (Local Area Networks).

[0015] The display unit 15 has a display screen and displays information on the display screen based on the control of the CPU 11. The display screen is, for example, a liquid crystal display screen, but is not limited to that. The display unit 15 may also have LED lamps or the like to indicate the operating status.

[0016] The operation reception unit 16 receives an input operation and outputs an input signal corresponding to the received content to the CPU 11. The operation reception unit 16 receives, for example, an input operation from a keyboard, a pointing device, or the like. Note that the display unit 15 and the operation reception unit 16 may be configured separately from the information processing apparatus 1 and attached as peripheral devices to operate.

[0017] Next, the claw detection operation will be described. The claws referred to here may include any of the claws of hands and feet. Detection of claws in a captured image (finger image) of a finger including a claw is performed by image recognition processing. A machine learning model 132 is used for the image recognition processing.

[0018] As a machine learning model related to image recognition, deep learning, particularly a deep neural network (DNN), is widely used. For region identification, semantic segmentation that obtains the probability that each pixel belongs to a plurality of identification targets (classes) and estimates the class of each pixel is preferably used. However, the algorithm is not limited to this.

[0019] The machine learning model 132 needs to be learned in advance by learning data 133. Supervised learning is used for learning the machine learning model 132. In this learning, the result (the distribution of the above probabilities) obtained for the input data is compared with the teacher data (the probability that each pixel belongs to the class is 100%). Then, the difference (deviation amount) is quantitatively evaluated as a loss by a loss function and fed back to the parameters of the machine learning model 132. For feedback, for example, the gradient descent method is used. Alternatively, the error backpropagation method or the like may be used for feedback. The learning data 133 includes a large number of combinations of image data including a detection target to be input data and teacher data indicating the correct answer of the range of the detection target preset in association with the image data.

[0020] In training machine learning models using semantic segmentation, cross-entropy (multi-class cross-entropy error function) and mean squared error are commonly used as loss functions. These loss functions determine the degree of mismatch (error) for each pixel within a region. Therefore, these loss functions do not explicitly reflect how much each pixel deviates from the contour position of the claw N shown in the training data (claw contour).

[0021] In the learning method of the machine learning model 132 of this embodiment, the shortest distance between each point (pixel) on the estimated contour and the contour shown in the training data is included in the error calculation. This improves the deviation, especially near the boundary, in this embodiment.

[0022] Figure 2 illustrates the detection misalignment of the nail contour. In the finger image, the nail N is located near the tip of the finger F. In contrast, an example of the nail detection range Ni is shown by a dotted line.

[0023] This detection range Ni includes three large misrecognition areas Nd1 to Nd3 relative to the nail N. Misrecognition areas Nd1 and Nd2 are areas of misrecognition that were detected as being narrower than the range of the nail N, while misrecognition area Nd3 is an area of ​​misrecognition that was detected as being wider than the range of the nail N. Such misrecognition can occur due to various factors, such as cutting the nails too short, changes in color under or around the nail (due to excessive pressure on the finger, poor circulation due to cold, etc.), hangnails around the nail, and the degree of light reflection.

[0024] The displacement width in each of these displacement regions Nd1 to Nd3 (here, the maximum widths df1 to df3 are shown) are different. Even within each region, the displacement width is non-uniform with respect to each contour position (pixel).

[0025] Figure 3 illustrates the calculation of the displacement for each contour position. For each pixel (boundary point Nip) on the contour line (second contour position) of the detection range Ni, the closest (shortest distance) pixel is identified from the positions Np (coordinates) of each pixel on the contour line (first contour position) of the training data, claw N. The distance between this position Np and the boundary point Nip is defined as the shift width df. Here, the distance may be the Euclidean distance in units of pixels. Identifying the position Np closest to the boundary point Nip may be done simply by calculating and comparing the distance from the boundary point Nip for all points (all pixels) on the contour line of claw N. Alternatively, considering that the contour line of claw N is circumferential, one of various algorithms that quickly asymptotically approach the two points where the distance is minimized may be used.

[0026] Note that the detection range Ni may have fine irregularities at its boundary due to noise, etc. Such fine irregularities do not usually occur on a human finger (and even if they do occur, they are usually not left as they are). Therefore, it may be possible to adjust the boundary between the inside and outside of the nail N by approximating the boundary with a curve or a straight line using a low-pass filter or similar method in a range of a few pixels to 10 pixels before and after the boundary.

[0027] In the information processing device 1, a penalty is set for each boundary point Nip identified in this way, according to the displacement, and this penalty is multiplied by the error. A correction loss is calculated based on the error that has the penalty taken into account. In the information processing device 1, the correction loss is added to the conventional loss, such as the mean squared error, and used. Here, the penalty is simply a value proportional to the displacement (Euclidean distance). Alternatively, the penalty may be a value proportional to the square of the displacement or its logarithm (a power other than 1).

[0028] Figure 4 is a flowchart showing the control procedure by the CPU 11 for the learning control process, which is the learning method (program) for the machine learning model of this embodiment. This learning control process is started, for example, based on the user's input operation to the operation reception unit 16, along with the specification of the learning dataset.

[0029] The CPU 11 acquires the specified training dataset (step S101). It is also possible to retain a portion of the training dataset for validation of the trained machine learning model 132. In this case, the CPU 11 selects an appropriate proportion or number of training data from the acquired training dataset for validation.

[0030] The CPU 11 selects one training data (a finger image including the nail and information on the nail range or nail contour (first contour position), which is the training data) from the training data included in the training dataset (step S102; first acquisition step, first acquisition means). The CPU 11 inputs the training finger image from the selected training data into the machine learning model 132 (step S103). The CPU 11 acquires the results output from the machine learning model 132, in this case, the probability distribution data (information related to the nail region) for each class including the nail region (step S104). The processing in steps S103 and S104 constitutes the second acquisition step and second acquisition means of this embodiment.

[0031] The CPU 11 calls and executes the loss value calculation process (step S105). The CPU 11 determines whether the obtained loss is the smallest so far (step S106). If it is determined that the loss is the smallest, the CPU 11 stores the machine learning model 132 based on the parameters at this point as a trained model (step S107). If there is already a trained model stored, the CPU 11 may overwrite and update the trained model with a new one. Then, the CPU 11 proceeds to step S108. If it is determined that the loss is not the smallest ("NO" in step S106), the CPU 11 proceeds to step S108.

[0032] When the process moves to step S108, the CPU 11 calculates the loss gradient and updates (feeds back) the parameters based on that gradient (step S108). The processes in steps S105 and S108 constitute the comparison and adjustment step and comparison and adjustment means of this embodiment.

[0033] The CPU 11 determines whether the convergence conditions for the learning results of the machine learning model 132 are met (step S109). Convergence conditions include, for example, that the most recently trained model has not been updated for a set number of consecutive times, and that the change in the magnitude of the loss has been below a threshold for a set number of consecutive times.

[0034] If it is determined that the convergence condition is met ("YES" in step S109), the CPU 11 terminates the learning control process. If it is determined that the convergence condition is not met ("NO" in step S109), the CPU 11 determines whether or not more than the upper limit number of training finger images have been input (step S110). If it is determined that more than the upper limit number of training finger images have not been input ("NO" in step S110), the CPU 11 returns to step S102. If it is determined that more than the upper limit number of training finger images have been input ("YES" in step S110), the CPU 11 terminates the learning control process.

[0035] Figure 5 is a flowchart showing the control procedure by the CPU 11 for the loss value calculation process called in the learning control process.

[0036] The CPU 11 calculates the error for each pixel using the training data and the output result (a probability distribution representing the fingernail), and generates an error map representing the distribution of that pixel. The CPU 11 also calculates a conventional loss value based on the error map (step S151). The conventional loss value is, for example, the mean squared error as described above.

[0037] The CPU 11 extracts the nail contour from the output result (probability distribution of the class) or the estimated nail region and from the training data (step S152). If the nail contour has already been identified in the training data, only the nail contour from the output result may be extracted.

[0038] The CPU 11 calculates the displacement of each point (pixel) on the claw contour of the output result, that is, the shortest distance from that pixel to the claw contour of the training data (step S153). The CPU 11 multiplies the error of each pixel shown in the error map by a penalty (in this case, simply the displacement itself) corresponding to the displacement calculated for that pixel, and generates a correction map (step S154). The CPU 11 calculates a correction loss value based on the correction map (step S155).

[0039] The CPU 11 calculates the loss corresponding to the deviation by adding the calculated conventional loss value and the corrected loss value (step S156). The addition may be performed with appropriate weighting. The CPU 11 finishes the loss value calculation process and returns the process to the learning control process.

[0040] Furthermore, in the calculation of the deviation range described above, if the difference in the nail contour is significantly large, the distance obtained may be to a position that does not actually correspond. In particular, if the extracted nail contour is significantly inward from the nail contour shown in the training data, the point on the opposite side of the annular nail contour in the training data may be closer. Such a shortest distance is inaccurate in terms of the magnitude of the error.

[0041] The information processing device 1 may, for example, restrict the process so that the line connecting the extracted points (pixels) on the nail contour to the inside of the nail contour in the training data does not pass through the inside of the extracted nail contour. Alternatively, the information processing device 1 may, for example, determine the discontinuity in the order of the identified positions after the positions connected by the shortest distance for all points on the nail contour in the finger image have been identified. If there is a discontinuity, the information processing device 1 may narrow the calculation range for the problematic area and recalculate the displacement.

[0042] The trained model obtained as described above can be used to estimate the nail region (contour). The trained model may be output to an external device, copied (stored), and used. The external device may include a printing device that prints within the nail region estimated by the trained model. However, the obtained trained model is not necessarily usable unconditionally. As described above, the nail contour obtained from the trained model may be compared with the nail contour shown in the training data using separately defined training data for verification. If the result of the comparison process shows that the size of the discrepancy is within a statistically necessary range, then the trained model can be used and output to an external device, etc., and copied.

[0043] Furthermore, the configuration for performing the above-mentioned machine learning in the information processing device 1 may also be provided in the printing device (its control unit). That is, the printing device comprises a CPU, RAM, a storage unit, a printing operation unit that performs printing operations (in this case, inkjet printing that ejects ink), and a detection unit, particularly an imaging unit, that detects fingers including the nails to be printed. The CPU, RAM, and storage unit may be included in the control unit of this embodiment. The CPU of the printing device trains the machine learning model stored in the storage unit using the same processing as the CPU 11 described above. The CPU then identifies the nails from the captured image (finger image) of the finger including the nails to be printed, captured by the imaging unit, using the trained machine learning model, and determines the image formation range so as to eject ink to form an image within the range of the identified nails. Note that the detection unit only detects the outline of the finger, and the finger image may be taken externally. However, it is preferable that the orientation of the finger is the same at the time of shooting and at the time of finger outline detection. Therefore, the printing device can easily and accurately estimate the nail area and set the printing range in one go by capturing the finger with its own imaging unit.

[0044] [Differentiation] In the above example, a penalty based on the deviation was uniformly applied to all points on the nail contour; however, a penalty based on the deviation may be applied to only some of the points. Furthermore, the penalty may be assigned a non-uniform weight depending on its range. Figure 6 illustrates an example of setting the weighting range. Here, a portion of the nail contour Rg on the fingertip side of the nail N on finger F is set. The penalty weight for the nail contour extraction range corresponding to this range Rg can be made greater than for other parts, namely the sides and the base.

[0045] Such a range Rg may be manually defined when setting the nail contour (nail region) of the training data and included in the training data. Alternatively, the angular range from the center position of the nail to the range Rg may be set in advance. In this case, for example, the center (centroid) position and the central axis are determined for the nail N (nail contour) of the training data, and the direction (angle) of each point relative to the central axis is determined. This process may be performed automatically by the CPU 11 or the CPU of an external device.

[0046] As described above, the learning method for the machine learning model 132 by the information processing device 1 of this embodiment includes: a first acquisition step of acquiring a finger image including the nail N and training data indicating the contour position of the nail N (nail contour) in the finger image; a second acquisition step of inputting the finger image into the machine learning model 132 and acquiring information related to the nail detection range Ni output from the machine learning model 132; and a comparison and adjustment step of calculating a loss corresponding to the difference between the contour position of the extracted nail detection range Ni and the contour position of the nail N defined by the acquired training data and feeding it back to the machine learning model 132. The loss function used to calculate the loss is defined so as to include in the loss a magnitude corresponding to the amount of deviation between each point of the two contour positions. That is, in this machine learning method, not only is the difference between each pixel used as the loss, but the magnitude (amount of deviation) of how much it deviates from the contour position of the nail N is also added to the loss. As a result, regardless of whether the misclassification is a subtle difference in the output probability value or a clear misclassification, a large deviation in the classification position can be evaluated as a large loss. Therefore, this machine learning method can improve the accuracy of the deviation optimization. Therefore, this machine learning method makes it possible to obtain a trained model with higher accuracy in nail contour detection.

[0047] Furthermore, the amount of deviation is determined based on the shortest distance from each point of the contour location extracted by the machine learning model 132 to the contour location of the training data fingernail N. Although this machine learning method does not establish a perfect one-to-one correspondence between the two contours, it allows for easy determination and evaluation of an appropriate deviation range for one of the contours (extracted contour locations) from the training data contour.

[0048] Furthermore, the loss may be calculated by applying a non-uniform weighting to the magnitude of the displacement, depending on the area of ​​the nail. Depending on the application, the area of ​​the nail's contour that is important may differ. Therefore, in this machine learning method, a larger penalty corresponding to the displacement can be set for the important area, allowing the model to learn to improve the accuracy of that important part.

[0049] Furthermore, the weight may be greater for the tip of the nail than for the sides and base of the nail N. In nail printing, for example, precise alignment near the tip of the nail is often important for design purposes, while precise alignment at the base is not always guaranteed. Therefore, this machine learning method calculates loss by assigning weights to each range according to the required contour accuracy, thereby obtaining information about the nail range with greater precision.

[0050] Furthermore, the machine learning model 132 may utilize semantic segmentation. This makes it easier to train the machine learning model 132 stably as an image region recognition technique, and therefore easier to obtain a trained model capable of accurate judgment.

[0051] Furthermore, the trained model in this embodiment is trained using the machine learning model training method described above. By using the trained model obtained using the above training method to estimate the range (contour) of the nail from a finger image, it becomes possible to obtain more accurate estimation results.

[0052] Furthermore, the information processing device 1 as a learning device in this embodiment includes a CPU 11. The CPU 11 acquires a finger image including the nail and training data indicating the contour position of the nail N in the finger image. The CPU 11 inputs the finger image to a machine learning model 132 and acquires information related to the nail detection range Ni output from the machine learning model 132. The CPU 11 calculates a loss corresponding to the difference between the contour position of the nail detection range Ni obtained from the output of the machine learning model 132 and the contour position of the nail N acquired as training data, and feeds this loss back to the machine learning model 132. At this time, the loss function used to calculate the loss is defined so that the magnitude of the loss includes a value corresponding to the amount of difference between each point of the contour position of the nail detection range Ni and each point of the contour position of the nail N. In this way, by reflecting the amount of misalignment of the fingernail contour as a penalty amount in the loss during the training of the machine learning model 132, the information processing device 1 can improve the accuracy of contour estimation.

[0053] Furthermore, the printing apparatus of this embodiment includes a CPU that performs the functions of the processing unit as described above as a learning device, a printing operation unit that performs operations related to printing, and a detection unit that detects the finger including the nail to be printed by the printing operation unit. The control unit determines the printing range for the finger detected by the detection unit based on the nail region estimated from the finger image including the nail to be printed using a machine learning model learned by the learning device. Such a printing device allows for more precise identification of the nail area and reliable printing (nail printing) on ​​that area.

[0054] Furthermore, by installing and running the program 131 related to the above-described machine learning method on a computer such as the information processing device 1, the accuracy of nail recognition can be easily improved.

[0055] Furthermore, by manufacturing a printing apparatus that trains a machine learning model using the above-described machine learning model training method and stores the trained model so that it can be used by the control unit, it is possible to obtain a printing apparatus that can determine the nail area with greater accuracy than conventional methods and print on that nail area.

[0056] It should be noted that the present invention is not limited to the embodiments described above, and various modifications are possible. For example, the amount of deviation was determined by the shortest distance between the contour of the detection range Ni and the contour of the training data claw N, but is not limited to this. For example, the amount of deviation may be the distance between two points with equal azimuth angles from the center position of claw N. Also, in the above embodiment, the shortest distance from each point on the contour line of the training data claw N to the contour of the detection range Ni was determined, but the opposite may also be used. That is, the distance from a point on the contour line of the detection range Ni to a point on the contour line of the training data claw N may be determined.

[0057] Furthermore, in the above embodiment, a penalty corresponding to the displacement is set only for points on the contour, but this is not limited to this. For all points within the displacement region, the distance from the contour related to the fingernail N in the training data may be calculated and set.

[0058] Furthermore, in the above modification, the weight of the toe portion was set to be relatively large, but this is not the only option. The weight of other parts may also be increased. In addition, the weight may be divided into finer ranges and set in multiple stages.

[0059] Furthermore, the loss function does not have to be the mean squared error or cross-entropy, as long as the loss can be appropriately evaluated.

[0060] Furthermore, the machine learning algorithm does not have to be semantic segmentation. Other algorithms for region segmentation, such as instance segmentation, can be used to avoid recognizing the area outside the finger. In principle, as long as one fingernail N is identified on one finger, there is no difference in nail detection between the two methods. In addition, any model can be selected for use as the encoder / decoder, including conventionally known models.

[0061] Furthermore, while the above embodiment controlled machine learning using a single information processing device 1, it is not limited to this. The operation may be controlled so that some of the processing necessary for learning is performed by an external device. In addition, the contents of this disclosure are applicable to machine learning other than that related to nail image recognition. That is, the above technology can be used even when the object to be recognized and learned is not a nail.

[0062] Furthermore, while the above description has used a storage unit 13 consisting of an HDD, flash memory, or other non-volatile memory as an example of a computer-readable medium for storing the machine learning control program 131 of the present invention, the invention is not limited to these. Other computer-readable mediums that can be used include other non-volatile memories such as MRAM, and portable recording media such as CD-ROMs and DVD discs. In addition, a carrier wave can also be used as a medium for providing the program data of the present invention via a communication line. Furthermore, the specific configurations, processing operations, and procedures shown in the above embodiments can be modified as appropriate without departing from the spirit of the present invention. The scope of the present invention includes the scope of the invention described in the claims and its equivalents. [Explanation of Symbols]

[0063] 1. Information Processing Device 11 CPU 12 RAM 13 Storage section 131 Programs 132 Machine Learning Models 133 Training Data 14 Communications Department 15 Display 16 Operation reception section F finger N claw Ni detection range Rg range

Claims

1. A first acquisition step involves acquiring a finger image including the nail and training data indicating the first contour position of the nail in the finger image. A second acquisition step involves inputting the aforementioned finger image into a machine learning model and obtaining information related to the nail region output from the machine learning model. A comparison and adjustment step which involves calculating a loss corresponding to the difference between the first contour position and the acquired second contour position of the claw region and feeding this loss back to the machine learning model, Includes, The loss function used to calculate the aforementioned loss is determined such that the loss includes an amount corresponding to the displacement between each point of the first contour position and each point of the second contour position. How to train machine learning models.

2. The method for learning a machine learning model according to claim 1, wherein the amount of displacement is determined based on the shortest distance from each point of the first contour position to the second contour position.

3. The method for learning a machine learning model according to claim 1, wherein the loss is determined by applying a non-uniform weighting to the magnitude corresponding to the amount of displacement, according to the range of the claw.

4. The method for learning a machine learning model according to claim 3, wherein the magnitude of the weighting is such that the tip of the nail is greater than the side and root of the nail.

5. A method for training a machine learning model according to claim 1, wherein semantic segmentation is used in the machine learning model.

6. Obtain a finger image including the nail and training data indicating the position of the first contour of the nail in the finger image, The aforementioned finger image is input into a machine learning model, and information relating to the nail region is obtained from the machine learning model. The loss corresponding to the difference between the first contour position and the acquired second contour position of the claw region is calculated and fed back to the machine learning model. Equipped with a processing unit, The loss function used to calculate the aforementioned loss is determined such that the loss includes an amount corresponding to the displacement between each point of the first contour position and each point of the second contour position. Learning device.

7. A control unit having the learning device described in Claim 6, A printing operation unit that performs operations related to printing, A detection unit that detects a finger including a nail to be printed by the printing operation unit, Equipped with, The control unit determines the printing range for the finger detected by the detection unit, based on the nail region estimated from the finger image including the nail to be printed, using the machine learning model learned by the learning device. Printing device.

8. A computer, A first acquisition means for acquiring a finger image including the nail and training data indicating the first contour position of the nail in the finger image. A second acquisition means inputs the aforementioned finger image into a machine learning model and obtains information relating to the nail region output from the machine learning model. A comparison and adjustment means that calculates a loss corresponding to the difference between the first contour position and the acquired second contour position of the claw region and feeds it back to the machine learning model. To make it function as, The loss function used to calculate the aforementioned loss is determined such that the loss includes an amount corresponding to the displacement between each point of the first contour position and each point of the second contour position. program.

9. A method for manufacturing a printing apparatus comprising a control unit, a printing operation unit that performs printing operations, and a detection unit that detects a finger including a nail to be printed by the printing operation unit, A first acquisition step involves acquiring a finger image including the nail and training data indicating the first contour position of the nail in the finger image. A second acquisition step involves inputting the aforementioned finger image into a machine learning model and obtaining information related to the nail region output from the machine learning model. A comparison and adjustment step which involves calculating a loss corresponding to the difference between the first contour position and the acquired second contour position of the claw region and feeding this loss back to the machine learning model, Includes, The loss function used to calculate the loss is defined such that the loss includes an amount corresponding to the displacement between each point of the first contour position and each point of the second contour position. How to train machine learning models The machine learning model is trained, and the machine learning model is stored so that it can be used by the control unit. A method for manufacturing a printing apparatus.