Data processing system, data processing method and data processing program
The data processing system addresses image quality deterioration by using a machine learning model to remove lens deposits, improving object detection accuracy and enabling precise analysis.
Patent Information
- Application Number
- JP2023053721
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-10
AI Technical Summary
Conventional techniques fail to automatically resolve image quality deterioration caused by lens deposits, leading to decreased object detection accuracy, and lack technology to enhance object detection precision post-deterioration.
A data processing system utilizing a machine learning model to remove lens deposits from images, generating a post-removal image that enhances object detection accuracy by minimizing the difference between detection results and correct values.
The system effectively removes lens deposits, enabling high-precision object detection by generating images with reduced deposit influence, facilitating accurate analysis and maintenance scheduling.
Smart Images

Figure 2024141867000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a data processing system, a data processing method, and a data processing program. [Background technology]
[0002] If the lens of a camera used for surveillance or the like becomes dirty, the accuracy of the surveillance or the like decreases. Patent Document 1 discloses a technology that uses a discrimination model to determine whether or not a defect caused by lens dirt, fogging, or the like occurs in an image, and detects defective photographic data. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent No. 6616906 Summary of the Invention [Problem to be solved by the invention]
[0004] Conventional techniques cannot automatically eliminate image quality degradation. Furthermore, in order to analyze captured objects after eliminating image quality degradation, it is necessary to eliminate image quality degradation so that objects in the images can be detected with high accuracy. Conventionally, there has been no technique for eliminating image quality degradation that takes into account the accuracy of object detection. The present invention has been made in consideration of the above-mentioned problems, and has an object to improve the accuracy of object detection based on an image after removal of attached matter. [Means for solving the problem]
[0005] In order to achieve the above-mentioned objective, the data processing system comprises an image acquisition unit that acquires an image captured by a camera, and a machine learning model that has been trained to input the image captured by the camera and output a post-removal image in which any adhesions on the lens of the camera have been removed, wherein the machine learning model has been trained to input a dirt image including the adhesions into the machine learning model and output a post-removal image, reducing the difference between the post-removal image and an image not including the adhesions, and also reducing the difference between the detection result of an object contained in the post-removal image output by inputting the dirt image into the machine learning model and a correct answer value indicating the object contained in the dirt image. The machine learning model has been trained to input the captured image and output the post-removal image.
[0006] That is, in the data processing system, a machine learning model that generates an image in which the adhesions on the lens are removed from an image captured by a camera is generated in advance by machine learning. The machine learning model is trained so that the difference between the detection result of the object contained in the post-removal image output by inputting a dirt image containing the adhesions into the machine learning model and the correct answer value indicating the object contained in the dirt image is small. Therefore, when an image captured by a camera is input into the machine learning model, a post-removal image in which the adhesions have been removed can be generated, and the post-removal image is generated so as to have high object detection accuracy. Therefore, when object detection is performed based on the post-removal image, object detection can be performed with high accuracy. [Brief description of the drawings]
[0007] [Figure 1] FIG. 1 is a block diagram of a data processing system. [Diagram 2] FIG. 2 is a diagram illustrating a generative model and a discriminative model. [Diagram 3] 1 is a flowchart of a machine learning process. [Figure 4] FIG. 11 is a diagram illustrating an example of object detection and a relationship between the correct answer value. [Diagram 5] FIG. 1 is a diagram for explaining IoU. [Figure 6]13 is a flowchart of an image generating process. [Figure 7] 11A and 11B are diagrams illustrating a process for identifying the amount of attached matter. [Figure 8] 13 is a flowchart of a machine learning model update process. [Figure 9] FIG. 13 is a diagram for explaining updating teacher data. [Figure 10] 13 is a flowchart of an image generating process. [Figure 11] 13 is a flowchart of an image generating process. [Figure 12] 13 is a flowchart of an object detection model update process. [Figure 13] FIG. 11 is a diagram illustrating an example of object detection and a relationship between the correct answer value. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] Here, the embodiments of the present invention will be described in the following order. (1) Data processing system configuration: (2) Administrator terminal configuration: (3) Image generation processing: (4) Machine learning model update process: (5) Other embodiments:
[0009] (1) Data processing system configuration: 1 is a block diagram showing the configuration of a data processing system. In this embodiment, the data processing system includes an image analysis system 10 and an administrator terminal 100. The image analysis system 10 includes a camera 40, and is installed at a position where the camera 40 can capture an image of an object to be captured. The image analysis system 10 analyzes the captured image captured by the camera 40 and performs various analytical processes. The analytical processes include a process of generating a post-removal image in which any attachments on the lens have been removed from the captured image, and a process of detecting an object from the post-removal image.
[0010] The object photographed by the camera 40 may be various objects, and there may be a plurality of image analysis systems 10. In this embodiment, the object photographed is a road, and an image analysis system 10 is installed at each of a plurality of positions where each of the objects can be photographed by the camera 40. Although one image analysis system 10 is illustrated in FIG. 1, in reality, a plurality of image analysis systems 10 are in operation, and the other image analysis systems 10 are omitted from the illustration. There may be a plurality of administrator terminals 100, but in this embodiment, it is assumed that one administrator terminal 100 is used.
[0011] The image analysis system 10 includes a control unit 20, a storage medium 30, a camera 40, and a communication unit 50. The control unit 20 includes a CPU, RAM, ROM, etc. (not shown), and can execute various programs recorded in the storage medium 30, etc. The communication unit 50 is a device that communicates with the administrator terminal 100. The form of communication is not limited, and wired communication or wireless communication can be used. The control unit 20 can transmit various information to the administrator terminal 100 via the communication unit 50, and can also receive various information from the administrator terminal 100.
[0012] The camera 40 is a device that forms an image of a landscape within a field of view on an image sensor by a lens. The control unit 20 controls the camera 40 and can acquire a captured image captured by the camera 40. The control unit 20 can also detect objects included in the captured image, such as cars, bicycles, pedestrians, buildings, trees, etc. In this embodiment, the camera 40 is installed outdoors. Therefore, rain, snow, mud, etc. may adhere to the lens during the operation of the image analysis system 10. If a captured image is acquired with an object attached to the lens, the captured image may contain an image of the object, resulting in a state in which a part of the landscape or object within the field of view that is originally intended to be captured is not captured.
[0013] Therefore, in this embodiment, the control unit 20 executes the image analysis program 21 to remove the attached matter, and performs object detection based on the image after removal. To execute such processing, the image analysis program 21 has the functions of a photographed image acquisition unit 21a, an attached matter removal unit 21b, an object detection unit 21c, a display control unit 21d, and a warning control unit 21e. The photographed image acquisition unit 21a causes the control unit 20 to execute a function of acquiring a photographed image captured by the camera 40. In this embodiment, the control unit 20 acquires a photographed image output from the camera 40 at a default frame rate by the function of the photographed image acquisition unit 21a, and stores the photographed image data 30a in the storage medium 30.
[0014] The deposit removal unit 21b causes the control unit 20 to execute a function of inputting a captured image to the machine learning model 30b and outputting a post-removal image from which deposits have been removed. The machine learning model 30b is a model that has been machine-trained to input an image captured by the camera 40 and output an image from which deposits on the lens of the camera 40 have been removed. Specifically, the machine learning model 30b is information indicating an equation for deriving a correspondence between the two data when the gradation value for each pixel of the input image data is used as an input value and the gradation value for each pixel of the image data of the generated image is used as an output value.
[0015] In this embodiment, the machine learning model 30b is created in advance by the administrator terminal 100 before the image analysis system 10 is operated, and is stored in the storage medium 30. Furthermore, in this embodiment, additional machine learning is performed on the machine learning model 30b created in advance, and the machine learning model 30b can be updated during the operation process. The creation and update of the machine learning model 30b will be described later, but in this embodiment, machine learning is performed so that the detection accuracy of the object based on the post-removal image is increased. In this embodiment, the control unit 20 inputs each of the captured images output from the camera 40 at a default frame rate into the machine learning model 30b, and generates a post-removal image in which the attached matter has been removed from each captured image. The generated post-removal image is stored in the storage medium 30 as post-removal image data 30c.
[0016] The object detection unit 21c causes the control unit 20 to execute a function of inputting the post-removal image to the object detection model 30d and outputting the detection result of the object. The object detection model 30d is a machine-learned model that inputs the post-removal image generated by the function of the attachment removal unit 21b and detects an object included in the post-removal image. Specifically, the object detection model 30d is a machine-learned model that takes the gradation value of each pixel of the input post-removal image as an input value and outputs the position of a detection box, which is a rectangular frame surrounding an image of the object, and the reliability of a class indicating the type of object photographed within the detection box.
[0017] In this embodiment, the object detection model 30d is created in advance by the administrator terminal 100 before the image analysis system 10 is operated, and is stored in the storage medium 30. The object detection model 30d may be a model that has been machine-learned using various known methods. In this embodiment, the control unit 20 performs object detection on each of the post-removal image data 30c using the object detection model 30d, and stores the object detection results in the storage medium 30 as detection data 30e.
[0018] The display control unit 21d causes the control unit 20 to execute a function of displaying the post-removal image on the display unit. In this embodiment, the display unit is provided in the administrator terminal 100. Then, the control unit 20 controls the communication unit 50 to transmit the post-removal image data 30c associated with the identification information of the image analysis system 10 to the administrator terminal 100. When the administrator terminal 100 receives the post-removal image data 30c, the administrator terminal 100 controls the display unit 400 provided in the administrator terminal 100 to display the post-removal image together with the identification information of the image analysis system 10.
[0019] As a result, the user of the administrator terminal 100 can visually confirm the image captured by the camera 40 of the image analysis system 10. Even if there is an attachment on the lens of the camera 40, the attachment is removed by the machine learning model 30b. Therefore, the image can be provided to the user in a state in which the influence of the attachment on the lens on the captured image is reduced. The user can make various judgments, such as the presence or absence of a traffic jam, based on the image in a state in which the influence of the attachment is reduced. Furthermore, even when an analysis based on an image (for example, counting the number of vehicles) is performed, the image can be analyzed based on the image in a state in which the influence of the attachment is reduced.
[0020] In this embodiment, the display control unit 21d also has a function of displaying the detected object on the display unit. The control unit 20 controls the communication unit 50 to transmit the detection data 30e associated with the identification information of the image analysis system 10 to the administrator terminal 100. When the administrator terminal 100 receives the detection data 30e, the administrator terminal 100 controls the display unit 400 included in the administrator terminal 100 to display information indicating the detected object together with the identification information of the image analysis system 10.
[0021] As a result, the user of the administrator terminal 100 can recognize objects photographed by the camera 40 of the image analysis system 10. Even if there is an object attached to the lens of the camera 40, the object is removed by the machine learning model 30b that has been machine-learned to improve the accuracy of object detection. Therefore, it is possible to provide the user with an object detection result based on an image in which the object has been removed while reducing the effect of the object on the lens on object detection. The user can perform various analyses, such as the presence or absence of traffic congestion, based on the object detection result.
[0022] The warning control unit 21e acquires the amount of the attached matter in the photographed image, and causes the control unit 20 to execute a function of outputting a warning to the warning unit based on the amount of the attached matter. In this embodiment, the amount of the attached matter is acquired based on the difference between the photographed image and the post-removal image. That is, since the post-removal image is an image after the attached matter has been removed, it can be estimated that the greater the change in the post-removal image compared to the photographed image, the greater the amount of the attached matter contained in the original photographed image. Therefore, the control unit 20 compares the photographed image with the post-removal image, and acquires a numerical value as an index that increases as the difference between the two increases. The index may be acquired by various methods, and detailed examples will be described later. The control unit 20 acquires the amount of the attached matter based on the size of the index, and when the amount of the attached matter is equal to or greater than a predetermined standard (a second threshold value to be described later), it considers the amount of the attached matter on the lens of the camera 40 to be an amount that requires a warning.
[0023] When the amount of adhesion is deemed to be an amount that requires a warning, the control unit 20 controls the communication unit 50 to transmit to the administrator terminal 100 the identification information of the image analysis system 10 associated with the information indicating that the amount of adhesion on the lens is an amount that requires a warning. When the administrator terminal 100 receives this information, the administrator terminal 100 controls the display unit 400 provided in the administrator terminal 100 to display a warning that the amount of adhesion on the lens of the camera 40 is an amount that requires a warning, together with the identification information of the image analysis system 10. In this embodiment, the display unit 400 functions as the warning unit. Of course, the manner of the warning is not limited to a display, and a warning may be given by sound or the like.
[0024] As a result of the warning, the user of the administrator terminal 100 can recognize that the amount of adhesions on the lens of the camera 40 is the amount that is the subject of the warning. Therefore, the user can recognize that maintenance of the camera 40 is necessary in the image analysis system 10 indicated by the identification information. When maintenance of the camera 40 is necessary, the maintenance may be performed in various ways. For example, the user of the administrator terminal 100 may inform a maintenance person of the identification number of the image analysis system 10, and the maintenance person may clean or replace the lens of the camera 40. In addition to this, for example, the user of the administrator terminal 100 may notify a maintenance company of the identification number of the image analysis system 10, and the maintenance company may clean or replace the lens of the camera 40. Of course, the notification to the maintenance person may be automatically performed from the administrator terminal 100.
[0025] According to the above configuration, even if an excessive amount of adhesion is attached to the lens of the camera 40, the maintenance target can be easily identified and maintenance can be performed. In addition, when an excessive amount of adhesion is not attached to the lens of the camera 40, for example, when the adhesion can be sufficiently removed by processing by the machine learning model 30b, it is possible to prevent unnecessary maintenance from being performed. Therefore, it is possible to reduce or eliminate waste such as periodically visiting multiple image analysis systems 10 for maintenance.
[0026] Furthermore, according to the above configuration, even if any foreign matter is attached to the lens of the camera 40, it is removed, and object detection is performed based on the image after the foreign matter is removed, and the image is transmitted to the administrator terminal 100. Therefore, the user can recognize the object photographed by the camera 40. In this embodiment, the machine learning model 30b is generated by performing machine learning so that the detection accuracy of the object is increased when the object detection unit 21c detects the object based on the image after the foreign matter is removed. Therefore, according to this embodiment, the user can perform analysis, etc., based on the detection result detected with high accuracy.
[0027] (2) Administrator terminal configuration: Next, a configuration of the administrator terminal 100 will be described. The administrator terminal 100 includes a control unit 200, a storage medium 300, a display unit 400, and a communication unit 500. The display unit 400 is a display device that displays images. The communication unit 500 is a device that communicates with the image analysis system 10.
[0028] The control unit 200 includes a CPU, RAM, ROM, a GPU (Graphics Processing Unit), etc. (not shown), and can execute various programs recorded in a storage medium 300, etc. In this embodiment, the control unit 200 can execute a management program 210 for generating the machine learning model 30b and outputting the analysis results by the image analysis system 10. When the management program 210 is executed, the control unit 20 functions as a machine learning unit 210a, an object detection unit 210b, and an output control unit 210c.
[0029] The machine learning unit 210a causes the control unit 200 to execute a machine learning process that optimizes a training model that forms a neural network. In this embodiment, the learning target is the machine learning model 30b, and the object detection model 30d is a general-purpose machine learning model that is prepared in advance. The machine learning model 30b may take various forms, but in this embodiment, it is assumed that a model called pix2pix is machine-learned.
[0030] FIG. 2 is a diagram showing a machine learning model in this embodiment. In this embodiment, a generative model G and a discriminative model D are prepared as training models, and are alternately trained by competing with each other in an adversarial manner. The generative model G is a model that inputs an image and generates another image. Here, an image input to the generative model G is called an input image Ii, and an image output from the generative model G is called a generated image Ig. In machine learning, the input image Ii and the generated image Ig generated from the input image Ii are paired. In addition, a plurality of input images Ii are prepared. Therefore, for each input image Ii, there is a paired generated image Ig. In the upper center of FIG. 2, an arrow indicates that the input image Ii and the generated image Ig are paired. The input image Ii is an example of a stain image.
[0031] Two image pairs are input to the discrimination model D. The input image pair is a pair of an input image Ii and a generated image Ig, or a pair of two images associated by the teacher data 300a. The teacher data 300a is defined by preparing a plurality of pairs of an input image Ii that may include an attachment R and a target image It that does not include the attachment R. In this embodiment, the input image Ii included in the teacher data 300a is also an image input to the generation model G during machine learning. The input image Ii is also a captured image Ip captured by the camera 40 in a state in which an attachment may be attached to the lens.
[0032] On the other hand, the target image It is an image that does not include the adhering matter R, and is an image that is captured by the camera 40 in the same environment as the paired captured image Ip, with no adhering matter R attached to the lens. In the teacher data 300a, multiple pairs of the input image Ii and the target image It are also prepared. In the lower center of FIG. 2, an arrow indicates how the input image Ii and the target image It are associated in the teacher data 300a. The teacher data 300a may be generated by various methods. For example, multiple images captured in a state where an adhering matter is actually attached to the lens and a state where no adhering matter is attached may be prepared. In addition, an image captured in a state where no adhering matter is attached to the lens may be virtually generated by adding noise or the like to an image captured in a state where no adhering matter is attached to the lens. In addition, a machine learning model that inputs an image captured in a state where no adhering matter is attached to the lens and outputs an image with the adhering matter added may be generated in advance, and an image may be generated based on the machine learning model. In either case, the target image It is in a state where any attached matter that may be included in the input image Ii has been removed.
[0033] As described above, by utilizing the fact that the target image It corresponding to the input image Ii is defined by the teacher data 300a, the discrimination model D is trained to discriminate whether or not the two input image pairs are a combination included in the teacher data 300a. That is, when the input image pair is the input image Ii and the target image It, the correct answer label is defined as real, and when the input image pair is the pair of the input image Ii and the generated image Ig, the correct answer label is defined as fake.
[0034] The discrimination model D is trained using real and fake prepared as correct labels so that when the input image pair is a pair of an input image Ii and a target image It (correct label is true), the value of the discrimination signal output approaches a value indicating real. Also, when the input image pair is a pair of an input image Ii and a generated image Ig (correct label is false), the discrimination model D is trained so that the value of the discrimination signal output approaches a value indicating fake.
[0035] Furthermore, the generative model G is trained so that when a pair of an input image Ii and a generated image Ig is input to the discriminative model D, the value of the discrimination signal output is close to a value indicating real (the generated image Ig is mistaken for the target image It). In other words, training is performed so that the generated image Ig, which is generated when a captured image Ip as the input image Ii is input to the generative model G, is so close to the target image It that it is indistinguishable from the target image It. Since the target image It is an image of the captured image Ip with any attached matter removed, if the generated image Ig is trained so that it is indistinguishable from the target image It, the generated image Ig can be said to be a post-removal image Ie from which the attached matter has been removed.
[0036] In this embodiment, when learning the generative model G, machine learning is further performed so that the detection accuracy of the object based on the post-removal image Ie generated by the generative model G is increased. That is, machine learning is performed so that the difference between the detection result of the object included in the generated image Ig and the correct answer value indicating the object included in the input image is reduced. When the machine learning is completed and the generated image Ig and the target image It cannot be distinguished from each other, the generated image Ig can be said to be the post-removal image Ie from which the attached matter has been removed, and therefore machine learning is performed so that the detection accuracy of the object based on the post-removal image Ie generated by the generative model G is increased.
[0037] In order to perform the above machine learning, the teacher data 300a is prepared in advance before the machine learning is performed. As described above, the teacher data 300a includes a plurality of pairs of the input image Ii and the target image It, but in this embodiment, the teacher data 300a further includes a correct answer value of the object detection as information for generating the post-removal image Ie so as to improve the object detection accuracy.
[0038] The correct answer value is information indicating the position of an object contained in the target image It in the image and a class that is the type of the object. The correct answer value may be in various formats, but in this embodiment, the correct answer value is configured by information indicating the position and class of a correct answer box surrounding the object. In FIG. 2, the correct answer box Bt in the target image It is shown by a dashed line. The position of the rectangle can be expressed, for example, by the coordinates of two diagonally opposite vertices. The class can be expressed, for example, by a numerical value associated with the type of the detection target, such as a car, a bicycle, a pedestrian, a building, a tree, etc.
[0039] When the teacher data 300a as described above is prepared, machine learning can be performed using the teacher data 300a. Fig. 3 is a flowchart showing the machine learning process. In this embodiment, the machine learning process is performed in advance before the operation of the image analysis system 10 is started.
[0040] When the machine learning process is started, the control unit 200 initializes a variable Cycle for counting cycles to 0 by the function of the machine learning unit 210a, and sets the learning conditions (step S100). Here, the learning conditions include various settings necessary for learning, such as the definition of the training model of the generative model G and the training model of the discriminative model D, that is, the settings of the filter, activation function, loss function, and initial values of variable parameters that indicate the models. In addition, the learning conditions include settings of the number of training data and test data extracted from the teacher data 300a, the image size to be handled, and the threshold value to be compared with Cycle.
[0041] Next, the control unit 200 acquires the teacher data 300a by the function of the machine learning unit 210a (step S105). Next, the control unit 200 outputs a generated image Ig by the generative model G by the function of the machine learning unit 210a (step S110). That is, the control unit 200 acquires an input image Ii by referring to the teacher data 300a, and inputs it to the generative model G at the current time point to acquire a generated image Ig.
[0042] Next, the control unit 200 performs object detection by the function of the object detection unit 210b (step S115). The function of the object detection unit 210b is the same as that of the object detection unit 21c. In order to realize the same function, the storage medium 300 stores in advance an object detection model 30d that is the same as that of the image analysis system 10. FIG. 4 is a diagram for explaining an example of object detection. In the example of this embodiment, an object detection result associated with each default box set in advance in the image is output. Information indicating the detection result is stored in the storage medium 300 as detection data 30e. In the example shown in FIG. 4, an example of a generated image Ig is shown at the top of the figure, and 16 default boxes are set so as to overlap the generated image Ig.
[0043] When object detection is performed by the function of the object detection unit 210b, object detection results for the objects contained in each default box are output. Although the output format is not limited, in this example, a default box, a detection box that is a rectangular frame surrounding an image of a detected object, and a reliability of a class indicating the type of object photographed within the detection box are output. In FIG. 4, the default box is indicated by a solid line, and the detection box is indicated by a dashed line.
[0044] The format of the information indicating the detection result is not limited, but for example, in the case of the default box DB1 in FIG. 4, the default box DB1 is expressed by information indicating the center of gravity coordinates and the width and height of the box. The detection box B1 is also expressed by information indicating the center of gravity coordinates and the width and height of the box, but the detection box B1 is expressed by the difference between the center of gravity coordinates of the default box DB1 and the center of gravity coordinates of the detection box B1, the difference between the width of the default box DB1 and the width of the detection box B1, and the difference between the height of the default box DB1 and the height of the detection box B1. The reliability of the class is expressed by a value that increases as the possibility that the detected object is a car, a bicycle, a pedestrian, a building, a tree, etc. increases. Therefore, if the maximum value of the reliability of the class is equal to or greater than the reference value, it can be estimated that an object of the class has been detected. The size and number of the default boxes are not limited to the example shown in FIG. 4, and may be more or less, or default boxes of different sizes may be used in combination.
[0045] In this embodiment, the control unit 200 performs object detection on the generated image Ig. The correct answer value of the object included in the target image It is defined in the teacher data 300a. Therefore, by comparing the result of object detection on the generated image Ig with the correct answer value of the object included in the target image It, the accuracy of object detection based on the generated image Ig can be evaluated.
[0046] In Fig. 4, the ground truth box corresponding to the ground truth value of the target image It is illustrated in the lower part by a dashed line. For example, by comparing the detection box B1 of the generated image Ig with the ground truth box Bt, it is possible to evaluate how close the detection result by the detection box B1 is to the ground truth value. If the generative model G is trained so that the generated image Ig and the target image It cannot be distinguished, it can be said that the generated image Ig is the post-removal image Ie. Therefore, if the generative model G is trained to improve the accuracy of object detection based on the generated image Ig, the generative model G is trained to improve the accuracy of object detection based on the post-removal image Ie.
[0047] Next, the control unit 200 acquires a loss l_loss related to image evaluation based on the target image It and the generated image Ig using the function of the machine learning unit 210a (step S120). The loss can be acquired, for example, by a method similar to the well-known DCGAN (Deep Convolutional Generative Adversarial Networks), and may indicate the difference between the generated image Ig and the target image It.
[0048] Next, the control unit 200 acquires a loss E_loss1 related to the accuracy of the detection result from the object detection result using the function of the machine learning unit 210a (step S125). That is, the control unit 200 acquires an index for comparing the object detection result in step S115 with a correct answer value, and defines the loss E_loss1.
[0049] The loss may be defined in various ways. For example, the loss can be defined by obtaining an index for evaluating the position accuracy and the class estimation accuracy between the correct answer and the object detection result. In this embodiment, the IoU (Intersection over Union) is obtained for the evaluation. Figures 5A and 5B are diagrams for explaining IoU. In Figures 5A and 5B, the correct answer box Bt is indicated by a dashed line, and the detection box SB is indicated by a dashed line.
[0050] In FIG. 5A, the overlapping portion where the correct answer box Bt and the detection box SB overlap is shown in gray, and in FIG. 5B, the joining portion, which is a portion included in at least one of the correct answer box Bt and the detection box SB, is shown in gray. IoU is defined as the area of the overlapping portion / the area of the joining portion. If the IoU is large, the accuracy of object detection is estimated to be high, but if the IoU is small, the accuracy of object detection is estimated to be low.
[0051] Here, if the IoU is equal to or greater than a threshold (e.g., 0.5), the detection box is called a positive box, and if the IoU is smaller than the threshold, the detection box is called a negative box. The control unit 200 obtains the IoU for each detection box obtained for each default box by comparing it with the ground truth box Bt.
[0052] Furthermore, the control unit 200 calculates the error between the position of the correct answer box Bt indicated by the correct answer value and the position of the detection box SB for the positive box, and substitutes the error into an activation function such as an error output control function to determine the loss for evaluating the position accuracy. Furthermore, the control unit 200 evaluates the error between the class indicated by the correct answer value and the reliability of the class corresponding to the detection box SB for the positive box and the negative box, for example, by cross entropy, to determine the loss for evaluating the class estimation accuracy. These losses are multiplied by a predetermined coefficient and normalized. The control unit 200 obtains the above-mentioned IoU and the loss based on the IoU for all the generated images Ig obtained from the training data in the teacher data 300a, and obtains the sum of the losses as E_loss1.
[0053] Next, the control unit 200 acquires a composite loss by the function of the machine learning unit 210a (step S130). That is, the control unit 200 acquires the sum of the losses acquired in steps S120 and S125. Next, the control unit 200 adjusts parameters based on the composite loss by the function of the machine learning unit 210a (step S135). A publicly known algorithm can be used as the parameter adjustment algorithm. At this time, the machine learning of the discriminative model D is also advanced by a publicly known algorithm. That is, the control unit 200 fixes one of the generative model G and the discriminative model D and performs machine learning of the other, and further fixes the other with the learned parameters and performs machine learning of the other. In this embodiment, the loss E_loss1 is used when machine learning the generative model G, but of course, the loss E_loss1 may be used when machine learning the discriminative model D. Furthermore, when calculating the composite loss in step S130, a predetermined offset value may be added to the weighted sum of the values acquired in S120 and S125.
[0054] Next, the control unit 200 determines whether the combined loss is smaller than a predetermined threshold value (step S140), and if it is not determined that the combined loss is smaller than the threshold value, the control unit 200 increments the variable Cycle (step S145).Then, the control unit 200 determines whether the variable Cycle is equal to or greater than a maximum value (step S150), and if it is not determined that the variable Cycle is equal to or greater than the maximum value, the control unit 200 repeats the processes from step S105 onwards.
[0055] On the other hand, if it is determined in step S140 that the synthesis loss is smaller than a predetermined threshold value, or if it is determined in step S150 that the variable Cycle is equal to or greater than the maximum value, the control unit 200 records the machine learning model 30b (step S155). That is, the control unit 200 stores the post-training generative model G in the storage medium 300 as the machine learning model 30b. Furthermore, the machine learning model 30b is transmitted to the image analysis system 10 and is also stored in the storage medium 30. Note that before storing the machine learning model 30b in step S155, it may be determined that learning is complete using test data. If learning does not progress as planned, machine learning may be performed again by changing the learning conditions, for example.
[0056] According to the above process, when the generative model G is machine-learned, it is learned so that the result of object detection approaches the correct answer value. Therefore, the machine learning is performed so that the difference between the detection result of the object contained in the post-removal image Ie output by inputting the dirt image including the attached matter into the machine learning model 30b and the correct answer value indicating the object contained in the dirt image becomes small. As a result, the generative model G can be generated so that object detection can be performed with high accuracy.
[0057] (3) Image generation processing: Next, the image generation process executed in the image analysis system 10 will be described with reference to the flowchart shown in Fig. 6. The image generation process is executed after the machine learning model 30b is recorded in the storage medium 30. The image generation process is executed in a state where the image analysis system 10 is installed so that the subject to be photographed is located within the field of view of the camera 40. In this embodiment, the image generation process is executed repeatedly at the photographing period of the camera 40.
[0058] When the image generation process is started, the control unit 20 acquires a captured image by the function of the captured image acquisition unit 21a (step S200). That is, the control unit 20 stores the captured image data 30a indicating the captured image output from the camera 40 in the storage medium 30. Next, the control unit 20 inputs the captured image to the machine learning model by the function of the attachment removal unit 21b (step S205). That is, the control unit 20 inputs the captured image Ip indicated by the captured image data 30a to the machine learning model 30b. Next, the control unit 20 acquires a post-removal image by the function of the attachment removal unit 21b (step S210). That is, the control unit 20 regards the generated image Ig output from the machine learning model 30b as the post-removal image Ie, and stores the post-removal image data 30c indicating the post-removal image Ie in the storage medium 30.
[0059] Next, the control unit 20 detects objects included in the post-removal image Ie using the function of the object detection unit 21c (step S215). That is, the control unit 20 inputs the post-removal image Ie to the object detection model 30d, generates detection data 30e indicating the object detection result, and stores the detection data 30e in the storage medium 30.
[0060] Next, the control unit 20 controls the display of the post-removal image Ie and the object detection result by using the function of the display control unit 21d (step S220). That is, the control unit 20 controls the communication unit 50 to associate the post-removal image data 30c and the detection data 30e with the identification information of the image analysis system 10 and transmits them to the administrator terminal 100. The control unit 200 of the administrator terminal 100 includes an output control unit 210c, and controls the communication unit 500 by using the function of the output control unit 210c to receive the post-removal image data 30c and the detection data 30e and store them in the storage medium 300. Furthermore, the control unit 200 controls the display unit 400 by using the function of the output control unit 210c to display the post-removal image Ie indicated by the post-removal image data 30c in association with the identification information of the image analysis system 10. With the above configuration, the administrator can visually confirm the post-removal image Ie from which the attachment has been removed. Furthermore, the control unit 200 controls the display unit 400 by the function of the output control unit 210c to display the result of object detection indicated by the detection data 30e in association with the identification information of the image analyzing system 10. With the above configuration, the administrator can recognize the object photographed by the camera 40.
[0061] When step S215 is executed, the control unit 20 acquires the difference between the photographed image and the post-removal image by the function of the warning control unit 21e (step S225). In this embodiment, the photographed image and the post-removal image are images of the same size and shape. Therefore, the control unit 20 refers to the photographed image data 30a and the post-removal image data 30c, and performs a process for each pixel to acquire the difference in gradation value between pixels at the same coordinates. In this embodiment, the photographed image and the post-removal image are images consisting of three channels, red, blue, and green, so the process for acquiring the difference is performed for each pixel, and the sum of the differences is used as a value indicating the difference between each pixel. This configuration is one example, and the value indicating the difference for each pixel may be acquired in various ways. For example, the value obtained by multiplying the difference between each channel of red, blue, and green by a weighting coefficient and adding them may be used as a value indicating the difference for each pixel.
[0062] When the difference for each pixel is acquired, the control unit 20 acquires the ratio of pixels whose difference is equal to or greater than a preset value by the function of the warning control unit 21e (step S230). That is, the control unit 20 regards the image of a pixel whose difference value is equal to or greater than a preset value as an image of an adhering substance, and evaluates the amount of the adhering substance by the ratio of the pixel to the entire image. FIG. 7 shows an image Id in which pixels whose difference between the post-removal image Ie generated from the photographed image Ip by the machine learning model 30b and the photographed image Ip is colored gray, and the difference is smaller than the threshold value (close to 0) in the image Id. As shown in FIG. 7, when the post-removal image Ie in which the adhering substance on the lens is removed is generated, the difference between the photographed image Ip and the post-removal image Ie becomes close to 0 in the area where no adhering substance exists, and becomes large in the area where the adhering substance exists.
[0063] Therefore, the control unit 20 counts the number of pixels that are considered to be images of attached matter, and divides it by the total number of pixels to obtain the ratio of the attached matter to the image. Since the ratio of the attached matter to the image corresponds to the amount of the attached matter, in this embodiment, the amount of the attached matter attached to the lens is evaluated based on the difference between the captured image and the image after removal. With the above configuration, it is possible to easily, objectively, and automatically determine the amount of the attached matter attached to the lens of the camera 40.
[0064] Next, the control unit 20 determines whether the ratio acquired in step S230 is equal to or greater than a first threshold value (step S235) by the function of the warning control unit 21e, and if it is determined that the ratio is equal to or greater than the first threshold value, it further determines whether the ratio is equal to or greater than a second threshold value (step S240). In this embodiment, the first threshold value and a second threshold value greater than the first threshold value are defined in advance. The second threshold value is a threshold value for identifying that the lens of the camera 40 is so heavily soiled that maintenance of the camera 40 is required. The first threshold value is a threshold value for determining that it is preferable to update the machine learning model 30b because the lens of the camera 40 is soiled with soil.
[0065] If it is determined in step S235 that the ratio is not equal to or greater than the first threshold, the control unit 20 ends the image generation process. If it is determined in step S235 that the ratio is equal to or greater than the first threshold, and if it is determined in step S240 that the ratio is not equal to or greater than the second threshold, the control unit 20 outputs an instruction to start execution of the machine learning model update process to the administrator terminal 100 via the communication unit 50. When the control unit 200 receives the execution start instruction via the communication unit 500, the control unit 200 executes the machine learning model update process by the function of the machine learning unit 210a (step S245). The machine learning model update process will be described later.
[0066] If it is determined in step S235 that the ratio is equal to or greater than the first threshold value, and if it is determined in step S240 that the ratio is equal to or greater than the second threshold value, the control unit 20 considers that the amount of the deposits on the lens of the camera 40 is an amount that requires a warning, and executes warning output control (step S250). Specifically, the control unit 20 controls the communication unit 50 by the function of the warning control unit 21e, and transmits to the administrator terminal 100 the identification information of the image analysis system 10 in association with the information indicating that the amount of the deposits is an amount that requires a warning. The control unit 200 of the administrator terminal 100 controls the communication unit 500 by the function of the output control unit 210c, receives the information, and stores it in the storage medium 300. Furthermore, the control unit 200 controls the display unit 400 by the function of the output control unit 210c, and displays, together with the identification information of the image analysis system 10, warning information indicating that the amount of deposits on the lens exceeds the amount that requires a warning in the image analysis system 10 of the identification information. In response to the warning, the administrator performs maintenance of the camera 40 in the image analysis system 10 indicated by the identification information, i.e., performs lens installation, etc. If the machine learning model 30b has been updated before the maintenance, the machine learning model 30b may be reverted to the model before the update after the maintenance.
[0067] (4) Machine learning model update process: Fig. 8 is a flowchart of the machine learning model update process. The machine learning model update process is similar to the machine learning process shown in Fig. 3, but is partially different. In addition, the teacher data used in the machine learning model update process is not the teacher data 300a but the update teacher data 300b. In the machine learning model update process, step S107 is executed instead of step S105 shown in Fig. 3, and the update teacher data 300b is generated in the step S107.
[0068] FIG. 9 is a diagram for explaining the updating teacher data 300b. The updating teacher data 300b is information indicating a combination of an updating image Ir prepared in advance, a correct answer value indicating an object included in the updating image Ir, and a virtual dirt image Iv. Here, the virtual dirt image Iv is an image in which a virtual attachment is added to the updating image Ir. In this embodiment, an attachment image Iu indicating an attachment that is actually attached to the camera 40 is generated, and the attachment image Iu is added to the updating image Ir to generate a virtual dirt image Iv that virtually reproduces dirt. For this reason, in this embodiment, the attachment image Iu obtained by subtracting the post-removal image Ie output by inputting the photographed image Ip into the machine learning model 30b and the photographed image Ip is added to the updating image Ir to generate the virtual dirt image Iv.
[0069] The update image Ir is an image that does not include any attached matter R. The update image Ir may be the same as the target image It in the teacher data 300a, may be partially the same as the target image It, or may be different from the target image It. However, each of the multiple update images Ir has at least different objects included as subjects. Moreover, the update image Ir is a plurality of images captured by the camera 40 in a state where there is no (or almost no) object adhering to the camera 40. Moreover, in this embodiment, the objects included in the update image Ir are specified in advance and defined as correct values. The format for defining the correct values may be the same as that of the teacher data 300a. In FIG. 9, it is shown that the correct values are defined by rectangular correct boxes Bt, similar to the teacher data 300a.
[0070] The update training data 300b is a model for performing additional machine learning on the generative model G and the discriminative model D. For this reason, similar to the training data 300a, the update image Ir is paired with the virtual dirt image Iv.
[0071] In order to generate such updating teacher data 300b, the control unit 20 of the image analysis system 10 according to this embodiment transmits the captured image data 30a to the administrator terminal 100 via the communication unit 50 at a predetermined timing. The control unit 200 of the administrator terminal 100 acquires the captured image data 30a via the communication unit 500 and stores it in the storage medium 300. After the image analysis system 10 starts operating, the captured image data 30a is sequentially transmitted from the image analysis system 10 to the administrator terminal 100 and stored in the storage medium 300. Each captured image data 30a is an image captured by the same camera 40, but the amount and position of attached matter may differ.
[0072] Before the image analysis system 10 begins operation, information indicating multiple update images Ir and the correct answer values of the objects contained in each update image Ir is generated in advance and stored in the administrator terminal 100 as part of the update teacher data 300b.
[0073] When step S107 is executed with the above information stored in the storage medium 300, the control unit 200 generates update teacher data 300b. That is, based on the captured image data 30a, an adhering matter image Iu is generated, and added to the update image Ir to generate a virtual dirt image Iv. Specifically, the control unit 200 inputs each of the captured images Ip indicated by the captured image data 30a to the machine learning model 30b, and generates a post-removal image Ie.
[0074] Furthermore, the control unit 200 obtains the difference between the photographed image Ip and the post-removal image Ie. The control unit 200 regards a pixel where the difference is equal to or greater than a threshold as a pixel where an object is photographed. Then, the control unit 200 associates an object flag indicating that the pixel where the object is photographed is an object pixel, and attaches a non-object flag indicating that the pixel is a pixel other than the pixel where the object is photographed, thereby generating an object image Iu. The post-removal image Ie and the object image Iu are generated for each of the multiple photographed images Ip. Through the above process, multiple object images Iu showing the object attached to the camera 40 are obtained.
[0075] Furthermore, the control unit 200 generates a virtual dirt image Iv by adding the adhesion indicated by the adhesion image Iu to each of the multiple update images Ir. Specifically, the control unit 200 sets the gradation value of the pixel associated with the non-adhesive flag as the gradation value of the pixel of the update image Ir. Furthermore, the control unit 200 sets the gradation value of the pixel associated with the adhesion flag as the gradation value indicating the adhesion. The gradation value indicating the adhesion may be a predetermined gradation value (for example, a gradation value indicating gray), may be the gradation value of the captured image Ip at the pixel associated with the adhesion flag, or may be various values.
[0076] When the virtual dirt image Iv is generated, the generated virtual dirt image Iv is paired with the original update image Ir. As a result of the above, update teacher data 300b is generated, which includes the update image Ir, a correct answer value indicating an object contained in the update image Ir, and the virtual dirt image Iv that is paired with the update image Ir.
[0077] When step S107 is executed in the machine learning model update process, the processes from step S110 onwards are executed, which are almost the same as the machine learning process shown in FIG. 3. However, since the teacher data referred to in the machine learning model update process is the update teacher data 300b, the control unit 200 sets the update image Ir as the target image It. The generated image Ig is an image generated by inputting the update image Ir to the machine learning model 30b being updated. Then, in step S155, the control unit 200 updates the existing machine learning model 30b with the generation model G being trained. That is, the control unit 200 updates the machine learning model 30b stored in the storage medium 300. Furthermore, the control unit 200 transmits the machine learning model 30b to the image analysis system 10 via the communication unit 500, and updates the machine learning model 30b stored in the storage medium 30.
[0078] According to the above process, even if the amount of adhesions on the lens of the camera 40 exceeds the first threshold and the adhesion removal rate and the object detection accuracy of the initial machine learning model 30b temporarily decrease due to an increase in adhesions since the start of operation, the machine learning model 30b is updated, so that the adhesion removal rate and the object detection accuracy can be restored. Therefore, it is possible to reduce the maintenance work of the camera 40 compared to a configuration in which the machine learning model 30b is not updated.
[0079] (5) Other embodiments: The above embodiment is an example for implementing the present invention, and various other embodiments can be adopted. For example, the image analysis system 10 and the administrator terminal 100 may be realized by multiple devices. Furthermore, machine learning may be performed by the image analysis system 10, or may be performed by other devices, such as a cloud server or a portable terminal. If machine learning can be performed in the image analysis system 10, additional learning can be performed using images captured at each site where the image analysis system 10 is installed, for example.
[0080] When machine learning is possible on a portable terminal, the terminal can be used as the administrator terminal 100, and machine learning can be performed at any location. Therefore, machine learning can be performed at the site where the image analysis system 10 is installed or in the vicinity thereof, and the learned machine learning model 30b can be transferred to the image analysis system 10 by any means such as a removable memory, wired communication, or wireless communication, and the machine learning model 30b can be updated. With this configuration, even if the image analysis system 10 is not connected to a computer such as the administrator terminal 100 for remote communication, the machine learning model 30b can be updated and a post-removal image in which the attached matter has been removed can be generated by the updated machine learning model 30b. Of course, in this configuration, the administrator terminal 100 may or may not be present.
[0081] Furthermore, the image analysis system 10 may be provided with a display unit, and the post-removal image may be displayed in the image analysis system 10. The image analysis system 10 may also be provided with a warning unit, and the image analysis system 10 may issue a warning.
[0082] Furthermore, at least some of the captured image acquisition unit 21a, the attachment removal unit 21b, the object detection unit 21c, the display control unit 21d, and the warning control unit 21e may be separated and present in multiple devices. Also, at least some of the machine learning unit 210a, the object detection unit 210b, and the output control unit 210c may be separated and present in multiple devices. Of course, some of the configurations of the above-mentioned embodiments may be omitted, and the order of processing may be changed or omitted.
[0083] The captured image acquisition unit may acquire a captured image captured by a camera. Therefore, the camera may be provided in the image analysis system 10, or an image captured by a camera installed outside the image analysis system 10 may be acquired. The captured image may be an image captured by a camera, and the captured image itself may be input to the machine learning model, or an image subjected to various processes may be input to the machine learning model. The various processes are not limited, and may include, for example, contrast and brightness adjustment, trimming, rotation, enlargement, reduction, noise removal, and other processes.
[0084] The object removal unit is only required to input the captured image to the machine learning model and output the image after removal of the object. Here, since the removal of the object is performed by the machine learning model, it can be said that the removal has been performed if an image that is likely to be captured by the camera when there is no object is obtained based on the captured image. In other words, the removal of the object does not necessarily mean that an image without the object is strictly obtained, and it is sufficient that at least a part of the object included in the captured image is close to being removed.
[0085] After the attachment is removed, it is preferable that there is an image of an object that is likely to be captured if the attachment does not exist. Therefore, it is preferable to perform machine learning so that an object partially hidden by the attachment can be reproduced. For this reason, it is preferable that the training data for machine learning includes an image including the object to be detected. For example, if an image including a road is captured by a camera, it is preferable that the training data includes not only an image including a stationary object such as a road, but also an image including a moving object that may be captured within the field of view, such as a car, a bicycle, a pedestrian, or a building.
[0086] Furthermore, since the post-removal image after the adhesion is removed is used for detecting the object, the machine learning model may be machine-trained to increase the accuracy of detecting the object based on the post-removal image. In this case, the machine learning model is machine-trained to reduce the difference between the post-removal image and the image not including the adhesion, and to reduce the difference between the detection result of the object included in the post-removal image and the correct answer value indicating the object included in the dirt image. The meaning of reducing the difference is that the machine learning algorithm is designed to correct the difference to a model with a small difference, and does not prevent the difference from temporarily becoming large during the repeated learning process. Such a learning method is not limited to the method of the above-mentioned embodiment. For example, the method of defining the loss is one example, and various methods can be adopted. In addition, the mode for detecting the object is not limited to the method of the above-mentioned embodiment, and various modes can be adopted.
[0087] The adhesions are various objects that may adhere to the lens and block the subject, and the type is not limited. For example, the adhesions may be rain, snow, mud, stones, or residues left after water on the lens evaporates. Objects that may block the subject, such as fog or mist, may be removed by the machine learning model.
[0088] The machine learning model may be a model that has been machine-learned to input an image captured by a camera and output an image from which any adhering matter on the camera lens has been removed, and may be a model that has been machine-learned to make the object detection result approach the correct answer. The input and output formats are not limited, and images of various types may be input and output. That is, either the captured image captured by the camera itself or an image that has been processed from the captured image may be input. The format of the input image and the output image may be the same or different.
[0089] The machine learning model may be a model that converts a captured image into a post-removal image, and may have various configurations other than those described above. That is, the machine learning model may be an image-image conversion model obtained by various aspects of DCGAN or their derivatives, conditional GAN, etc.
[0090] The mode of machine learning is not limited, and machine learning may be performed by appropriately selecting various elements such as the number of layers and the number of nodes constituting the neural network, the type of activation function, the type of loss function, the type of gradient descent method, the type of optimization algorithm for gradient descent method, the presence or absence of mini-batch learning and the number of batches, the learning rate, the initial value, the type or presence or absence of an overlearning suppression method, the presence or absence of a convolutional layer, the size of the filter in the convolution operation, the type of filter, the type of padding or stride, the type or presence or absence of a pooling layer, the presence or absence of a fully connected layer, and the presence or absence of a recursive structure. Of course, learning may be performed by other machine learning, such as a support vector machine, clustering, or reinforcement learning. Furthermore, machine learning may be performed in which the structure of the model (for example, the number of layers, the number of nodes per layer, etc.) is automatically optimized. Various modes may also be adopted as the mode of various parameters. For example, the range of the identification signal output from the identification model D is not limited to 0 to 1, and may be a range of 0 to 100, etc.
[0091] In addition, in the above embodiment, the output of the discriminative model D is one output, but the aspect of the discriminative model D is not limited to this aspect. For example, a model may be defined so that two outputs are obtained from the discriminative model D, and a value representing a false accuracy is output from one, and a value representing a true accuracy is output from the other. In this case, when the discriminative model D and the generative model G are trained, the difference between the vector consisting of two outputs and the corresponding target vector is back-propagated, and training is performed in the same manner as in the above embodiment.
[0092] The warning control unit may output a warning to the warning unit based on the amount of the adhering matter. That is, the warning control unit may warn the user when an amount of the adhering matter that is the subject of a warning is attached to the camera lens. The comparison between the captured image and the post-removal image is not limited to the configuration in which the difference in the gradation value for each pixel is obtained as in the above-mentioned embodiment. That is, instead of the difference in the gradation value, or in addition to the difference in the gradation value, various comparisons may be performed. For example, comparison of various feature amounts of the images, comparison of histograms, comparison of contrast, brightness, etc. may be performed. In addition, a configuration in which a part of each image is compared and the remaining part is not compared may be adopted. For example, if the image includes a road, the captured image and the post-removal image may be compared in the road and the part including the road, and the remaining part such as the sky may not be compared.
[0093] The amount of adhesion may be obtained based on the comparison of the images. The amount of adhesion may be evaluated by various indices. Therefore, in addition to the configuration in which the amount of adhesion is evaluated based on the ratio of pixels whose difference is equal to or greater than a threshold to all pixels as in the above-mentioned embodiment, various configurations may be adopted. For example, the amount of adhesion may be evaluated based on the cumulative value of the magnitude of the difference, or a part that is different between the images to be compared based on the difference or the like may be specified, and a part with a small area among the part may be removed as noise. In addition, the shape of the continuous adhesion may be reproduced based on the shape of the part that is different between the images to be compared based on the difference or the like, and the amount of adhesion may be evaluated.
[0094] Whether or not to output a warning may be determined based on the amount of attached matter, and a warning may be issued according to the amount of attached matter. For example, the strength of the warning may increase stepwise or continuously as the amount of attached matter increases. Furthermore, the warning unit may be provided in the image analysis system 10, or may be provided in an external device to the image analysis system 10 as in the above-mentioned embodiment. In any case, it is sufficient for the warning control unit to be able to cause the warning unit to output a warning.
[0095] Furthermore, the images to be compared to evaluate the amount of adhesion are not limited to the configuration of a photographed image and a post-removal image as in the above-mentioned embodiment. For example, the images to be compared may be a photographed image photographed at a predetermined time and a reference photographed image prepared in advance. Here, the reference photographed image may be an image that serves as a reference for evaluating the degree of increase in adhesion, and may be, for example, a photographed image photographed by the camera 40 at the first predetermined time after the image analysis system 10 is installed.
[0096] The specified time may be any time when it is estimated that there are few subjects. For example, if the captured image includes a road, a time when there is little traffic is assumed, and if the captured image includes a parking lot, a time when there is little parking is assumed. Examples of such times include roads that are relatively empty on holidays, early mornings on holidays in parking lots, etc. In any case, it is estimated that objects such as vehicles included in the captured image captured at the specified time are not significantly different from the reference captured image. Therefore, if the difference between the captured image captured at the specified time and the reference captured image is obtained, it can be estimated that the obtained difference is mainly composed of attached objects.
[0097] Therefore, a configuration may be made so that such a comparison is performed. This configuration can be realized by partially modifying the above-described embodiment. Specifically, this can be realized by modifying the image generation process shown in FIG. 6 as shown in FIG. 10. In FIG. 10, the same processes as those in FIG. 6 are indicated by the same reference numerals as those in FIG. 6, and processes different from those in FIG. 6 are indicated by reference numerals different from those in FIG. 6. Specifically, the image generation process shown in FIG. 10 is the image generation process shown in FIG. 6 to which steps S202 and S203 have been added. In addition, the reference captured image is stored in advance in storage medium 30 (not shown).
[0098] In step S202, the control unit 20 uses the function of the warning control unit 21e to identify the current time based on a timer circuit (not shown) and determines whether the current time is a predetermined time. If it is not determined in step S202 that the current time is the predetermined time, the control unit 20 executes the processes from step S205 onwards, similar to the process shown in FIG.
[0099] On the other hand, if it is determined in step 202 that the current time is the predetermined time, the control unit 20 acquires the difference between the captured image taken at the predetermined time and the reference captured image using the function of the warning control unit 21e (step S203). That is, the control unit 20 refers to the captured image data 30a and acquires the captured image taken at the predetermined time (or the captured image taken at the time closest to the predetermined time) from among the captured images taken in step S200. The control unit 20 also acquires the reference captured image stored in the storage medium 30. Then, the control unit 20 refers to the captured image taken at the predetermined time and the reference captured image, and performs a process for each pixel to acquire the difference in gradation value between pixels at the same coordinates.
[0100] When the difference for each pixel is acquired, the control unit 20 executes the process from step S230 onward by the function of the warning control unit 21e. However, when step S230 is executed through step S203, the ratio of pixels whose difference is equal to or greater than a preset value is acquired based on the difference acquired by step S203. According to the above process, the amount of adhesion on the camera 40 can be evaluated without depending on the post-removal image Ie. Therefore, even if the accuracy of removing the adhesion by the post-removal image Ie is reduced, the amount of adhesion on the camera 40 can be evaluated. Therefore, even if the accuracy of removing the adhesion by the post-removal image Ie is reduced, the amount of adhesion can be accurately evaluated, and the timing of updating the machine learning model and the timing of outputting a warning can be determined.
[0101] Furthermore, the machine learning unit may perform additional learning of the object detection model 30d. The timing of performing additional learning of the object detection model 30d may be the same as that of the machine learning model 30b, or may be different. FIG. 11 is a flowchart showing a process of performing additional learning of the object detection model 30d at the same timing as that of the machine learning model 30b. This configuration can be realized by modifying the image generation process shown in FIG. 6 as shown in FIG. 11 in the same configuration as the above-mentioned embodiment. In FIG. 11, an object detection model update process of step S247 is added after step S245 of the image generation process shown in FIG. 6.
[0102] Fig. 12 is a flowchart showing an object detection model update process. In the example shown in Fig. 12, a machine learning model update process is executed in step S245 before the object detection model update process in step S247. Therefore, before the object detection model update process starts, the update image Ir and the virtual dirt image Iv have already been generated as the update teacher data 300b. The update teacher data 300b also includes the correct answer value of the object included in the update image Ir.
[0103] When the object detection model update process is started in this state, the control unit 200 initializes a variable Cycle for counting cycles to 0 by the function of the machine learning unit 210a, and sets the learning conditions (step S300). This process is similar to step S100 in FIG. 3.
[0104] Next, the control unit 200 performs object detection on the update image Ir and the post-removal image Ie of the virtual stain image Iv using the function of the object detection unit 210b (step S305). Specifically, the control unit 200 refers to the update teacher data 300b and acquires the update image Ir and the virtual stain image Iv. The control unit 200 also inputs the virtual stain image Iv to the machine learning model 30b to generate the post-removal image Ie. Furthermore, the control unit 200 inputs the update image Ir and the post-removal image Ie of the virtual stain image Iv to the current object detection model 30d to acquire the results of the respective object detection.
[0105] Next, the control unit 200 acquires losses E_loss0 and E_loss1 related to the accuracy of the detection result from the result of the object detection using the function of the machine learning unit 210a (step S310). That is, the control unit 200 acquires an index for comparing the object detection result in step S305 with a correct answer value, and defines losses E_loss0 and E_loss1.
[0106] FIG. 13 is a diagram for explaining object detection in step S305 using an update image Ir as an example. In this embodiment, object detection is performed on each of the post-removal image Ie of the virtual dirt image Iv and the update image Ir. The upper part of FIG. 13 illustrates an example of an object detection result on the post-removal image Ie of the virtual dirt image Iv. That is, in the post-removal image Ie shown in the upper part of FIG. 13, a default box DB1 and a detection box B1 corresponding to the default box DB1 are illustrated by a thick solid line and a dashed dotted line.
[0107] The correct answer value of the object included in the updating image Ir is defined in the updating teacher data 300b. Therefore, by comparing the result of object detection for the image Ie after removal of the virtual dirt image Iv with the correct answer value of the object included in the updating image Ir, the accuracy of object detection based on the image Ie after removal of the virtual dirt image Iv can be evaluated.
[0108] In FIG. 13, the correct answer box corresponding to the correct answer value of the update image Ir is illustrated in the middle by a dashed line. For example, by comparing the detection box B1 of the post-removal image Ie of the virtual dirt image Iv with the correct answer box Bt, it is possible to evaluate how close the detection result by the detection box B1 is to the correct answer value. Therefore, by using the object detection result for the post-removal image Ie of the virtual dirt image Iv and the correct answer value, it is possible to evaluate the accuracy of object detection when the post-removal image Ie is input to the object detection model 30d. Therefore, by incorporating this evaluation into the loss, it is possible to perform additional learning of the object detection model 30d so as to improve the accuracy of object detection in the post-removal image Ie.
[0109] Also, the lower part of FIG. 13 illustrates an example of an object detection result for the update image Ir. That is, in the update image Ir shown in the lower part of FIG. 13, a default box DB1 and a detection box B2 corresponding to the default box DB1 are illustrated by a thick solid line and a dashed line. By comparing the detection box B2 of the update image Ir with the correct answer box Bt, it is possible to evaluate how close the detection result by the detection box B2 is to the correct answer value. Therefore, by using the object detection result for the update image Ir and the correct answer value, it is possible to evaluate the accuracy of object detection when the update image Ir is input to the object detection model 30d. Therefore, by incorporating the evaluation into the loss, it is possible to perform additional learning of the object detection model 30d so as to improve the accuracy of object detection of the update image Ir, which is a clean image.
[0110] The loss may be defined in various ways, but for example, the loss can be defined by obtaining an index that evaluates the position accuracy and class estimation accuracy between the correct answer and the object detection result, and E_loss0 and E_loss1 are obtained by the same process as in step S125 described above. Here, too, the control unit 200 obtains E_loss0 and E_loss1 for all update images Ir included in the update teacher data 300b.
[0111] Next, the control unit 200 acquires the composite loss by using the function of the machine learning unit 210a (step S315). That is, the control unit 200 acquires the sum of E_loss0 and E_loss1. Of course, when acquiring the sum, various size adjustments and normalizations may be performed. Next, the control unit 200 adjusts parameters based on the composite loss by using the function of the machine learning unit 210a (step S320). The parameter adjustment algorithm may be a known algorithm. For example, an algorithm such as SSD (Single Shot Multibox Detector) or YOLO (You Only Look Once) may be used.
[0112] Next, the control unit 200 determines whether the composite loss is smaller than a predetermined threshold value (step S325), and if it is not determined that the composite loss is smaller than the threshold value, the control unit 200 increments the variable Cycle (step S330).Then, the control unit 200 determines whether the variable Cycle is equal to or greater than a maximum value (step S335), and if it is not determined that the variable Cycle is equal to or greater than the maximum value, the control unit 200 repeats the processes from step S305 onward.
[0113] On the other hand, if it is determined in step S325 that the synthesis loss is smaller than the predetermined threshold value, or if it is determined in step S335 that the variable Cycle is equal to or greater than the maximum value, the control unit 200 records the object detection model 30d (step S340). That is, the control unit 200 stores the object detection model 30d after training in the storage medium 300. The object detection model 30d is also transmitted to the image analysis system 10 and stored in the storage medium 30. Note that before storing the object detection model 30d in step S340, it may be determined that learning using test data has ended. If learning does not progress as planned, machine learning may be performed again by changing the learning conditions, for example.
[0114] According to the above process, the result of object detection based on the image Ie after removing the virtual dirt image Iv and the result of object detection based on the update image Ir are both trained to approach the correct answer (to reduce the difference). Therefore, the object detection model 30d can be generated so that object detection can be performed with high accuracy.
[0115] In the above-mentioned updating teacher data 300b, the updating image Ir and the correct answer value of the object contained in the updating image Ir are prepared in advance, but the updating image Ir may be generated during the operation of the image analysis system 10. For example, a configuration may be adopted in which the image captured by the camera 40 is used as the updating image Ir, and the result of object detection obtained by inputting the captured image into the object detection model 30d is used as the correct answer value. In this configuration, it is preferable that the captured image is captured in a state where there is little adhesion. For example, the updating image Ir and the correct answer value may be generated based on the captured image captured within a predetermined period immediately after the image analysis system 10 is installed or immediately after maintenance (cleaning of the lens, etc.) is performed on the camera 40. According to this configuration, the effort required to generate the updating teacher data 300b can be reduced. Furthermore, additional learning of the machine learning model 30b and the object detection model 30d may be performed based on the updating teacher data 300b and the teacher data 300a.
[0116] When the object detection model 30d or the machine learning model 30b is additionally learned, the original object detection model 30d or the machine learning model 30b may be overwritten, or the updated model may be stored separately from the original object detection model 30d or the machine learning model 30b. In the latter case, it is possible to use the original model and the updated model depending on the needs of the user and the accuracy of the model.
[0117] The display control unit may display various information other than the post-removal image on the display unit as long as it can display the post-removal image on the display unit. For example, the display control unit may display the post-removal image and the installation position of the image analysis system 10 in association with each other on the display unit. The display control unit may also display the results of various processes on the post-removal image, for example, the analysis results of the post-removal image (such as the degree of congestion on a road) in association with the post-removal image on the display unit.
[0118] Furthermore, in a configuration including an object detection unit that detects an object included in the post-removal image, the display control unit may cause the display unit to display the detected object. In this case, the display mode is not limited to a specific mode and may be various modes. For example, the reliability of the detected object may be displayed.
[0119] Furthermore, the method of removing the image of the adhering matter from the image by the machine learning model as in the present invention can also be applied as a program or a method. In addition, the above-mentioned system, program, and method can be realized as a single device or a plurality of devices, and include various aspects. In addition, it can be modified as appropriate, such as being partly software and partly hardware. Furthermore, the invention can also be established as a recording medium of a program that controls the system. Of course, the recording medium of the software may be a magnetic recording medium or a semiconductor memory, and can be considered in exactly the same way in any recording medium developed in the future. [Explanation of symbols]
[0120] 10...image analysis system, 20...control unit, 21...image analysis program, 21a...captured image acquisition unit, 21b...adhesive removal unit, 21c...object detection unit, 21d...display control unit, 21e...warning control unit, 30...storage medium, 30a...captured image data, 30b...machine learning model, 30c...image data after removal, 30d...object detection model, 30e...detection data, 40...camera, 50...communication unit, 100...administrator terminal, 200...control unit, 210...management program, 210a...machine learning unit, 210b...object detection unit, 210c...output control unit, 300...storage medium, 300a...teaching data, 300b...teaching data for update, 400...display unit, 500...communication unit
Claims
1. a captured image acquisition unit that acquires a captured image captured by a camera; an adhesion removal unit that inputs an image captured by the camera and outputs a post-removal image in which adhesions on the lens of the camera have been removed, the machine learning model being trained to reduce the difference between the post-removal image outputted by inputting a dirt image including the adhesions into the machine learning model and an image not including the adhesions, and also to reduce the difference between a detection result of an object included in the post-removal image outputted by inputting the dirt image into the machine learning model and a correct answer value indicating the object included in the dirt image; and A data processing system comprising:
2. Based on the updating teacher data generated by combining a previously prepared updating image, a correct answer value indicating an object contained in the updating image, and a virtual dirt image obtained by inputting the photographed image into the machine learning model and adding an adhesion image obtained by subtracting the removed image and the photographed image to the updating image, The machine learning unit further performs additional learning of the machine learning model so as to reduce a difference between a detection result of an object included in the post-removal image output by inputting the virtual dirt image into the machine learning model and a correct answer value indicating the object included in the update image.
2. The data processing system of claim 1.
3. the machine learning unit performs the additional learning when the amount of the attachment included in the captured image is equal to or greater than a first threshold and is less than a second threshold (wherein the first threshold is less than the second threshold); and a warning control unit that outputs a warning to a warning unit when the amount of the adhesion is equal to or greater than the second threshold value.
3. The data processing system of claim 2.
4. The amount of the adhesion is acquired based on a difference between the photographed image and the post-removal image.
4. The data processing system of claim 3.
5. The amount of the adhesion is acquired based on a difference between the captured image captured at a predetermined time and a reference captured image prepared in advance.
4. The data processing system of claim 3.
6. an object detection unit that inputs the post-removal image to an object detection model that has been machine-learned to input the post-removal image and detect an object included in the post-removal image and outputs a detection result of the object; The machine learning unit performs additional learning of the object detection model so as to reduce a difference between a detection result of an object included in the post-removal image output by inputting the virtual dirt image into the machine learning model and a correct answer value indicating an object included in the update image.
3. The data processing system of claim 2.
7. Further comprising a display control unit that causes the post-removal image to be displayed on a display unit.
3. The data processing system according to claim 1.
8. an object detection unit that detects the object included in the post-removal image; and a display control unit that causes the detected object to be displayed on a display unit.
3. The data processing system according to claim 1.
9. a photographed image acquiring step of acquiring a photographed image photographed by a camera; an object removal process for inputting the captured image to the machine learning model, the machine learning model being trained to input an image captured by the camera and output a post-removal image in which the object on the lens of the camera has been removed, the machine learning model being trained to reduce the difference between the post-removal image outputted by inputting the dirt image including the object into the machine learning model and an image not including the object, and also to reduce the difference between the detection result of the object included in the post-removal image outputted by inputting the dirt image into the machine learning model and a correct answer value indicating the object included in the dirt image; Data processing methods, including:
10. Computer, a captured image acquisition unit that acquires a captured image taken by a camera; an adhesion removal unit that inputs an image captured by the camera and outputs a post-removal image in which adhesions on the lens of the camera have been removed, the machine learning model being trained to reduce a difference between the post-removal image outputted by inputting a dirt image including the adhesions into the machine learning model and an image not including the adhesions, and also to reduce a difference between a detection result of an object included in the post-removal image outputted by inputting the dirt image into the machine learning model and a correct answer value indicating the object included in the dirt image; A data processing program that functions as a
Citation Information
Patent Citations
Image processing system
JP2017092622A
Image restoration device and restoration model generation device
JP2021117937A
Training image signal processors using intermediate loss functions
US20190050682A1
Device and system for detecting defective photographic data
JP6616906B1
