Image rotation
The digital image is corrected for rotation through a machine learning model, and the image pair training and classification loss update technology are used to solve the digital image tilt problem and improve the aesthetics and orientation accuracy of the image.
Patent Information
- Application Number
- CN202410377050.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-03-31
- Filing Date
- 2024-03-29
- Publication Date
- 2024-10-01
AI Technical Summary
Digital images are often slightly tilted when shooting, resulting in reduced aesthetics and orientation accuracy of the image. It is difficult for existing technology to effectively automatically correct image rotation.
A machine learning model is employed for training by generating and using image pairs, including a target training image and its randomly rotated version, the machine learning model is used to predict the rotation value of the image, and the model is updated with a classification loss to improve the accuracy of the rotation prediction.
It realizes automatic rotation correction of digital images, improves the aesthetics and orientation accuracy of the image, and simplifies the image processing process.
Smart Images

Figure CN118735787A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing. Certain embodiments relate to a method of determining the rotation of a digital image, the determination being performed using a computer or computer system implementing a machine learning solution. Other embodiments relate to a computer processing system or computer readable storage configured to perform such a method and associated methods and computer systems configured to rotate a digital image. Background Art
[0002] Digital images, such as photographs or videos stored as data, are ubiquitous in modern society. They can be and are often generated using digital cameras. In addition to dedicated cameras, digital cameras are now widely available, including on multi-function devices such as smartphones.
[0003] Digital images may be tilted slightly or sometimes significantly from a precise upright position. This may result in a reduction in the aesthetics of the image or a reduction in the orientation accuracy of the image, for example because lines that should appear vertical or horizontal appear incorrectly oriented. Both inexperienced and professional photographers often, even commonly, capture images that are tilted slightly from a precise upright position when the intended photograph was taken in an upright position.
[0004] The software or firmware may automatically process digital image data, such as digital image data generated by the image capture hardware of a digital camera or received from or through another source. The automatic processing may seek to re-orient the digital image, such as by detecting edges or lines in the image and orienting the image with reference to the detected edges or lines. The Hough transform may be used to detect edges or lines.
[0005] The software or firmware may also or alternatively allow manual adjustment of the orientation of the digital image.The software or firmware may form part of a digital camera or other image generator, or may be run on a computer system separate from the digital camera or other image generator that has received the digital image data for processing.
[0006] The present disclosure relates to methods for using machine learning based solutions for image processing, in particular for image rotation. Summary of the invention
[0007] Methods for generating image pairs for training a machine learning model for image processing are described. Methods for using the image pairs to train a machine learning model for image rotation, and methods for image processing to predict image rotation values using the machine learning model so trained are also described.
[0008] A computer-implemented method for generating image pairs for training a machine learning model for image processing includes:
[0009] for each target training image of the plurality of target training images, forming at least one rotated image corresponding to the target training image, wherein each rotated image of the at least one rotated image is a version of the target training image rotated by a rotation value determined according to a random rotation selection process;
[0010] in:
[0011] Multiple target training images with target orientations for machine learning models;
[0012] The image pairs are formed by the target training image and the rotated image corresponding to the target training image, and wherein the method further comprises associating each image pair with a classification, the classification of the image pair corresponding to the rotation value or a discretized rotation value of the rotation value of the image pair.
[0013] A computer-implemented method for training a machine learning model for image rotation, comprising:
[0014] For each image pair in the plurality of image pairs, including a target image representing a target rotational orientation and a rotated image having a tilt away from the target rotational orientation, wherein the tilt has a discretized tilt value and within a discretized tilt value set, the discretized tilt value set includes a plurality of different tilt values:
[0015] applying a machine learning model to the rotated image to determine a set of predicted class probabilities corresponding to a discretized set of tilt values;
[0016] determining a classification loss, wherein the classification loss is based on the tilt value and the set of predicted class probabilities;
[0017] Update the machine learning model based on the objective of minimizing the classification loss.
[0018] A computer-implemented method for receiving data defining an image and determining and returning a predicted rotation value for the image includes: applying a trained machine learning model to the image by a computer processing system, the trained machine learning model determining a class of the image, wherein the class is one of a plurality of classes defined by the machine learning model, wherein each of the plurality of classes is or is associated with a rotation value, and wherein the rotation value is the predicted rotation value of the image.
[0019] A computer-implemented method of providing input to a machine learning model for images includes:
[0020] dividing the image into a plurality of images, including at least a first image corresponding to a first portion of the image and a second image corresponding to a second portion of the image, the second portion being different from the first portion of the image;
[0021] forming a first eigenvector of the first image and a second eigenvector of the second image; and
[0022] The first feature vector and the second feature vector are concatenated into a single vector, and the single vector is provided as input to the machine learning model.
[0023] Also described are a computer processing system and a non-transitory computer readable memory storing instructions for the computer processing system, which are configured to perform the methods disclosed herein.
[0024] Further embodiments will become apparent from the following description, which is given by way of example and with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 An example of a computer system in a client server architecture is shown.
[0026] Figure 2 A block diagram of a computer processing system is shown.
[0027] Figure 3 A method for generating a training image set for supervised machine-based learning is shown.
[0028] Figure 4 A method for machine learning based on a generated training image set comprising image pairs is shown, which can be used according to Figure 3 method to generate.
[0029] Figure 5 A method for determining image rotation of an image by applying a trained machine learning model, which may have been trained based on Figure 4 The method was trained.
[0030] Figure 6 is a method used to create input representing an image for a machine learning model. This method can be used with Figure 4 and Figure 5 methods are used in combination.
[0031] Figure 7 Depicts example partitioning of an image in preparation for training a machine learning model or applying a trained machine learning model.
[0032] Figure 8 A graphical representation of a machine learning architecture is shown. DETAILED DESCRIPTION
[0033] A machine learning solution for an image processing task is implemented by a computer system. In particular, the computer system comprises one or more data processing devices, which are configured, for example by software, to perform a data processing method according to the machine learning solution. The data processing method can be performed on one or more digital images, which are in a local or remote data non-transitory storage device or have been received through a communication channel and stored in a transient storage device.
[0034] Figure 1 An example of a computer system in the form of a client server architecture for image processing tasks is shown. Networked environment 100 includes a server environment 110 and client systems 130 communicating via one or more communication networks 140 (eg, the Internet).
[0035] Generally speaking, server environment 110 includes computer processing hardware 112, on which one or more applications that provide server-side functions to client applications are executed. In this example, the computer processing hardware 112 of server environment 110 runs server application 114 (which may also be referred to as front-end server application) and data storage application 116.
[0036] The server application 114 operates to provide an endpoint for a client application, such as the client application 132 on the client system 130, which can be accessed through the communication network 140. To this end, the server application 114 may include one or more applications, libraries, application programming interfaces (APIs), or other software elements that implement the features and functions described herein (including, for example, providing image processing). As an example, in the case where the server application 114 serves a web browser client application, the server application 114 will be a network server that receives and responds to, for example, HTTP application protocol requests. In the case where the server application 114 serves a native client application, the server application 114 will be an application server configured to receive, process, and respond to API calls from those client applications. The server environment 110 may include both a network server and an application server application that allows it to interact with the network and native client applications.
[0037] In addition to the specific set of functionality described herein, server application 114 (alone or in conjunction with other applications) may provide additional functionality typically provided by a server system—such as user account creation and management, user authentication, and / or other server-side functionality.
[0038] The data storage application 116 operates to receive and process requests to persistently store and retrieve data in a data storage device related to operations performed / services provided by the server environment 110. Such requests may be received from the server application 114, other server environment applications, and / or in some instances directly from client applications such as the client application 132. The data related to operations performed / services provided by the server environment may include, for example, user account data, image data, and / or other data related to the operation of the server application 114. The data storage is provided by one or more data storage devices local or remote to the computer processing hardware 112. Figure 1 The example of shows a data store 118 in the server environment 110, and the following description refers to this device. The data store 118 can be, for example, one or more non-transitory computer-readable storage devices such as a hard disk, solid-state drive, tape drive, or alternative computer-readable storage devices.
[0039] In the server environment 110, the server application 114 stores data persistently to the data store 118 via the data store application 116. However, in alternative embodiments, the server application 114 may be configured to interact directly with the data store 118 to store and retrieve data, in which case a separate data store application may not be required. In addition, although a single data store application 116 is described, the server environment 110 may include multiple data store applications. For example, one data store application 116 may be used for user data and another data store application 116 may be used for image data. In this case, each data store application may interface with one or more shared data store 118 devices and / or one or more dedicated data store 118 devices, and each data store application may receive / respond to requests from various server-side and / or client-side applications (including, for example, the server application 114).
[0040] As described above, server applications 114 and data storage applications 116 run on (or are executed by) computer processing hardware 112. Computer processing hardware 112 includes one or more computer processing systems. The exact number and nature of these systems will depend on the architecture of server environment 110.
[0041] For example, in one embodiment, a single server application 114 runs on its own computer processing system and a single data storage application 116 runs on a separate computer processing system. In another embodiment, the single server application 114 and the single data storage application 116 run on a common computer processing system. In yet another embodiment, the server environment 110 may include multiple server applications running in parallel on one or more computer processing systems.
[0042] Communications between the applications and the computer processing systems of server environment 110 may be by any appropriate means, such as direct communications or networked communications over one or more local area networks, wide area networks, and / or public networks (with a secure logical overlay, such as a VPN, if desired).
[0043] The present disclosure describes various operations performed by applications of the server environment 110. However, in general, operations described as being performed by a particular application (e.g., the server application 114) may be performed by one or more alternative applications, and / or operations described as being performed by multiple separate applications may in some cases be performed by a single application. In addition, various operations may be performed in environments other than client-server architectures. For example, various operations may be performed on separate computer systems.
[0044] The client system 130 hosts a client application 132 which, when executed by the client system 130, configures the client system 130 to provide a client-side set of functionality / interact with the server environment 110, or more specifically the server application 114 and / or other applications provided by the server environment 110. Through the client application 132, a user can perform various operations, such as receiving image data from another device (such as a peripheral device) or from another computer, causing an image corresponding to the image data to be displayed, and sending and receiving image data to and from the server environment.
[0045] The client application 132 may be a general purpose web browser application that accesses the server application 114 through an appropriate uniform resource locator (URL) and communicates with the server application 114 through a general purpose World Wide Web protocol (e.g., http, https, ftp). Alternatively, the client application 132 may be a native application that is programmed to communicate with the server application 114 using defined API calls.
[0046] The client system 130 may be any computer processing system that is configured or configurable by hardware, firmware, and / or software to provide a client functional set. The client system 130 may be a desktop computer, a laptop computer, a tablet computing device, a mobile / smart phone, or other appropriate computer processing system. Similarly, the application programs of the server environment 110 are also executed by one or more computer processing systems. The server environment computer processing system will typically be a server system, but may be any appropriate computer processing system.
[0047] Figure 2 A block diagram of a computer processing system 200 that can be configured to perform the operations described herein is provided. The computer processing system 200 is a general purpose computer processing system. Thus, Figure 2 The computer processing system in the form shown forms, for example, a stand-alone computer processing system, all or part of the computer processing hardware 112 including the data storage 118, or all or part of the client system 130 (see Figure 1 ).exist Figure 1 Other general purpose computer processing systems may alternatively be used in the system.
[0048] It should be understood that Figure 2 Not all functional or physical components of a computer processing system are shown. For example, no power supply or power supply interface is depicted, although system 200 will carry a power supply or be configured for connection to a power supply (or both). It will also be understood that the particular type of computer processing system will determine the appropriate hardware and architecture, and that alternative computer processing systems suitable for implementing features of the present disclosure may have more, alternative, or fewer components than those depicted.
[0049] Computer processing system 200 includes at least one processing unit 202. Processing unit 202 may be a single computer processing device (e.g., a central processing unit, a graphics processing unit, or other computer-related device), or may include multiple computer processing devices. In some cases, where computer processing system 200 is described as performing an operation or function, all processing required to perform the operation or function will be performed by processing unit 202. In other cases, the processing required to perform the operation or function may also be performed by a remote processing device that can be accessed and used (in a shared or dedicated manner) by computer processing system 200.
[0050] Through communication bus 204, processing unit 202 is in data communication with one or more machine-readable storage (memory) devices that store computer-readable instructions and / or data that are executed by processing unit 202 to control the operation of processing system 200. In this example, computer processing system 200 includes system memory 206 (e.g., BIOS), volatile memory 208 (e.g., random access memory such as one or more DRAM modules), and non-transitory memory 210 (e.g., one or more hard disks or solid-state drives).
[0051] The computer processing system 200 also includes one or more interfaces, generally indicated at 212, through which the computer processing system 200 interfaces with various devices and / or networks. In general, other devices may be integrated with the computer processing system 200, or may be separate. In the case where a device is separate from the computer processing system 200, the connection between the device and the computer processing system 200 may be through wired or wireless hardware and communication protocols, and may be a direct or indirect (e.g., networking) connection.
[0052] Wired connections to other devices / networks may be through any appropriate standard or proprietary hardware and connection protocols. For example, computer processing system 200 may be configured to be wired to other devices / communication networks through one or more of the following: USB; eSATA; Ethernet; HDMI; and / or other wired connections.
[0053] Wireless connections to other devices / networks may similarly be through any appropriate standard or proprietary hardware and communication protocols. For example, the computer processing system 200 may be configured to wirelessly connect to other devices / communication networks using one or more of the following: Bluetooth; WiFi; Near Field Communication (NFC); Global System for Mobile Communications (GSM) and / or other wireless connections.
[0054] In general, and depending on the particular system in question, the devices to which the computer processing system 200 is connected, either by wire or wireless means, include one or more input devices to allow data to be input into / received by the computer processing system 200, and one or more output devices to allow data to be output by the computer processing system 200. Example devices are described below, however, it should be understood that not all computer processing systems will include all of the devices mentioned, and devices in addition to and in place of those mentioned may well be used.
[0055] For example, computer processing system 200 may include or be connected to one or more input devices through which information / data is input into (received by) computer processing system 200. Such input devices may include a keyboard, a mouse, a trackpad, a microphone, an accelerometer, a proximity sensor, a GPS, and / or other input devices. Computer processing system 200 may also include or be connected to one or more output devices controlled by computer processing system 200 to output information. Such output devices may include devices such as displays (e.g., LCDs, LEDs, touch screens, or other display devices), speakers, vibration modules, LEDs / other lights, and / or other output devices. Computer processing system 200 may also include or be connected to devices that can act as both input devices and output devices, such as memory devices (hard drives, solid-state drives, disk drives, and / or other memory devices) from which computer processing system 200 can read data and / or write data to, and touch screen displays that can both display (output) data and receive touch signals (input). User input and output devices are described in detail in the accompanying drawings. Figure 2 In the example, user input / output 214 is generally represented.
[0056] For example, where the computer processing system 200 is a client system 130, it may include a display 218 (which may be a touch screen display), a camera 220 device, a microphone 222 device (which may be integrated with the camera device), a pointer device 224 (e.g., a mouse, trackpad, or other pointing device), a keyboard 226, and a speaker 228 device.
[0057] Computer processing system 200 also includes one or more communication interfaces 216 for communicating with a network, such as network 140 of environment 100 (and / or a local network within server environment 110). Through communication interface 216, computer processing system 200 can transmit data to and receive data from networked systems and / or devices.
[0058] Computer processing system 200 may be any suitable computer processing system, such as a server computer system, a desktop computer, a laptop computer, a netbook computer, a tablet computing device, a mobile / smart phone, a personal digital assistant, or an alternative computer processing system.
[0059] Computer processing system 200 stores or has access to computer applications (also referred to as software or programs)—i.e., computer readable instructions and data that, when executed by processing unit 202, configure computer processing system 200 to receive, process, and output data. The instructions and data may be stored on non-transitory memory 210. The instructions and data may be transmitted to / received by computer processing system 200 via data signals in a transmission channel enabled, for example, by a wired or wireless network connection over an interface such as communication interface 216.
[0060] Typically, one application accessible to computer processing system 200 will be an operating system application. In addition, computer processing system 200 will store or have access to application programs that, when executed by processing unit 202, configure computer processing system 200 to perform the various computer-implemented processing operations described herein. For example, and with reference to above Figure 1 In the networked environment of FIG. 1 , the server environment 110 includes one or more systems running server applications 114 and data storage applications 116. Similarly, the client system 130 runs client applications 132.
[0061] In some cases, part or all of a given computer-implemented method will be performed by computer processing system 200 itself, while in other cases the processing may be performed by other devices in data communication with system 200 .
[0062] Figure 3 An embodiment of a method 300 performed by a computer processing system is shown. The operations of method 300 may be performed by an instance of computer processing system 200, for example.
[0063] Method 300 illustrates a method for generating a training image set for supervised machine-based learning. Method 300 may be performed during machine-based learning or as a prerequisite for machine-based learning. Figure 3 The arrangement of the steps in the figures and other figures representing the method are not intended to limit the disclosure to only the order of the steps shown, or to limit the disclosure to only serial or only parallel processing for any step.
[0064] In step 301, a target image set is received or generated. The target image represents an image having a target orientation (e.g., an exact or near exact upright position). The target image set may have different target orientations, for example, if an effect other than correcting the orientation of the image to an estimate of its correct upright position is desired. For simplicity and clarity of explanation, it is assumed in the remainder of the specification that the goal of the machine learning model is to rotate the image to an upright orientation.
[0065] The images in the target image set may be selected from the available image set based on knowledge that they are in an upright orientation or based on an assessment (e.g., an expert assessment that they are in an upright orientation). Alternatively or in addition, the images in the target image set may be generated wherein the generation configuration or constraint is to ensure that the images are in an upright orientation.
[0066] The images in the target image set may include images of different scenes or types. An example of an image scene or type is an image of a building. Another example is an image of a plant. Still other examples are images that include a horizon, a person, an animal, food. For general training of a machine learning model, the set of target images may span a large number of different scenes or types. Alternatively, where the training is for a specific scene or type or image, then the target image set may be only or primarily that scene or type. The number of images in each class may be substantially uniform, or may be based, for example, on the number of images to be used by the trained machine learning model according to the given scene or type. Figure 3 The training images generated by the method are weighted to certain classes based on the expected distribution of rotated images. Alternatively, random selections from the target image set (see below) can be weighted to implement a similar effect.
[0067] Large sets of target images are useful for machine learning. As an example, there may be 5,000 to 100,000 target images, or any number therebetween. In other examples, there may be more than 100,000 target images.
[0068] In step 302, a target image is selected from the target image set. The selected target image will be used for training and is therefore referred to herein as a target training image. In some embodiments, the selection is random. As used herein, the term "random" is intended to encompass a quasi-random process.
[0069] In step 303, a random rotation is selected, or in other words, a random tilt is selected. For example, a random selection of a rotation angle may be performed.
[0070] In some embodiments, for example, the random selection is constrained to be within a range of positive (clockwise) or negative (counterclockwise) 15 degrees. This can represent the range in which most users (e.g., photo shooters and / or manual editors of digital images) orient their images when capturing images or when editing images later. Other constraints less than positive or negative 15 degrees (e.g., 10 degrees or 5 degrees) or greater than positive or negative 15 degrees (e.g., 20 degrees or 25 degrees) can be used. Constraints need not be defined by integer values. It is expected that in most embodiments, the range will be symmetric about an upright target orientation and include an upright target orientation.
[0071] In some embodiments where the random selection of rotation values is constrained by a first constraint, the first constraint is not applied in some cases. In particular, in some embodiments, a portion of the target training image (e.g., a small portion (like about 1%)) is rotated an amount outside the range specified by the first constraint. The rotation is still randomly selected, but is based on a second constraint that requires or results from a probabilistic rotation value outside the first constraint. Taking the first constraint of 30 degrees formed by plus or minus 15 degrees (including the end values) as an example, the second constraint can be plus or minus 15 degrees to 35 degrees (including or not including either value), or can be any angle outside of plus or minus 15 degrees.
[0072] In some embodiments, the range of rotations available for selection is discretized, or the value selected from a substantially continuous range is rounded to the nearest discretized value. If the selected value matches the discretized value, it can be used without rounding. As an example, if the rotation is represented as an angle, the discretized value can have a step size of 0.1 degrees, which for a 30 degree range (e.g., plus or minus 15 degrees), results in 301 rotations available for selection in step 303. The step size can be less than or greater than 0.1 degrees. The step size can be uniform or non-uniform across the range, for example with a higher density for lower rotation values and a lower density for higher rotation values.
[0073] In step 304, a rotated image is formed based on the selected rotation. For example, in the case where the randomly selected rotation is or corresponds to +5.0 degrees, the target training image selected in step 302 is rotated 5 degrees clockwise to form a corresponding rotated image.
[0074] The combination of the rotated image formed in step 304 and the target training image corresponding to the rotated image from step 302 forms an image pair. As described later herein, sets of image pairs generated in this manner can be used for machine learning. Thus, in step 305, the pair association of the two images and the rotation value selected for the pair in step 303 are recorded by the computer processing system, for example in a lookup table or otherwise.
[0075] In some embodiments, the rotation values, or equivalently the rotated images, are each considered a class. For example, a rotation value of +5.0 degrees (or an image rotated by +5.0 degrees) is one class, a rotation value of -5.0 degrees (or an image rotated by -5.0 degrees) is another class, and a rotation value of +5.1 degrees (or an image rotated by +5.1 degrees) is still another class.
[0076] As described above, in some embodiments, a portion of the selected rotation values are outside the first constraint, such as outside plus or minus 15 degrees. In some embodiments, these are considered to be in a class different from the class covering the range specified by the first constraint, but in one or more common classes. For example, all rotation values outside plus or minus 15 degrees can be assigned to a common class. Although the designation of a common class is somewhat arbitrary, in one example, its designation can be an absolute value of 15 degrees. Therefore, for this example, in step 305, the association of a rotated image (and its associated target image) that has been rotated outside plus or minus 15 degrees is associated with the class of absolute value 15 degrees, rather than with a class based on its actual rotation relative to the target image.
[0077] In step 306, determine whether the end condition is met. In some embodiments, the end condition is to generate a certain number of image pairs. Large sets of image pairs are useful for machine learning. As an example, there may be 5,000 to 100,000 image pairs, or any number therebetween. In other examples, there may be more than 100,000 image pairs. In some embodiments, there are more image pairs than there are target images. In some embodiments, there are many more image pairs than there are target images, for example, 10 times the number, 100 times the number, or more, thereby effectively guaranteeing that a single target image will appear in more than one image pair, but with different rotated images due to the random selection of step 303.
[0078] If the end condition is not met, the method returns to step 302 to make another selection of the target image. In some embodiments, particularly those embodiments involving random selection in step 302, each selection is made from the complete set of available target images. In other embodiments, when a target image is selected, it is removed from the set of available target images for future iterations. If the number of iterations is greater than the number of target images, the complete set of available target images can be made available for selection again when no target images remain. If the end condition is met, the process ends. In other embodiments, steps 302 and 303 can be effectively combined, wherein each target image is rotated one or more times by a randomly selected rotation value.
[0079] In variations of the method for generating a training image set for supervised machine-based learning, the order of the steps can be changed and the steps can be changed to accommodate different processing procedures without substantially changing the generation of image pairs and associated rotation values. For example, the order of steps 301 to 303 can be changed, such as so that only a selected target image is received or generated (i.e., step 301 is performed after step 302). In addition, the selection of the rotation value can be before the selection of the target image or the reception or generation of the target image. In another example, with reference to the end condition, the process is not iterative. A non-iterative process can involve selecting all target images and all rotation values in a combined selection process.
[0080] In some embodiments, only image pairs generated using random selection of rotation values, such as described above, are used for machine learning. In other embodiments, these image pairs are used in combination with image pairs and associated rotation values from one or more other sources. In various embodiments, image pairs generated based on random selection of rotation angles form at least 20% or 30% or 40% or 50% or 60% or 70% or 80% or 90% of the image pairs used for machine learning.
[0081] Figure 4 An embodiment of a method 400 performed by a computer processing system is shown. The operations of method 400 may be performed, for example, by an instance of computer processing system 200 in conjunction with an implementation of method 300. Method 400 is a method for machine learning based on a generated training image set comprising an image pair. The image pair comprises a target image, a rotated image, and a rotation value indicating an amount by which the rotated image is tilted relative to the target image.
[0082] The rotation values are treated as classes for machine learning purposes. Thus, the rotation values may be discretized rather than continuous or substantially continuous, such as discretized into increments of 0.1 degree rotation. There may also be one or more classes representing ranges of rotation values, such as a class for incorporating all rotations outside a particular range, such as plus or minus 15 degrees. All, some, or none of the image pairs may be generated according to method 300 or a similar method involving random selection of rotation values and generation of rotated images based on the random selection.
[0083] In step 401, data defining a rotated image of an image pair is received or retrieved from a data store and an existing machine learning (ML) model is applied, the ML model being configured with existing model parameters. Applying the ML model to the rotated image generates an output image.
[0084] In a first iteration of method 400, existing model parameters have initialized values. Taking an ML model in the form of a neural network (e.g., a convolutional neural network (CNN)) as an example, initialization may include setting all weights of the ML model to random values according to a normal probability distribution or otherwise. Alternatively, and particularly for convolutional neural networks, initialization may include using pre-trained weights, e.g., based on previous training of the ML model. The ML model may be of different forms, such as a multilayer perceptron (MLP) network. In some embodiments, the ML model is a 2-hidden hierarchical MLP network.
[0085] The data defining the rotation of the image can be in the form of a feature vector. If the data defining the rotation of the image is the image data itself, a feature vector can be formed from the image data for input to the ML model. The feature vector of the image can be generated based on the image by a pre-trained convolutional neural network (CNN) model. 3D convolutional features are extracted from the last CNN layer, and the 3D convolutional features are converted into 1D (one-dimensional) feature vectors by calculating the global average pooling (GAP). In some embodiments, the feature vector can be generated using the MobileNet V3 model, which is described in the paper "Searching for MobileNetV3" (reference number arXiv: 1905.02244v5) by Howard et al. published by arXiv.org. In other embodiments, alternative models can be used. For example, such models can include AlexNet, ConveXt, DenseNet, EfficientNetV2, and GoogLeNet, which form part of the Linux Foundation project PyTorch.
[0086] In step 402, a classification loss, such as a multi-classification cross entropy loss, is determined. The neural network can predict class probabilities for various classes and provide outputs of probabilities. The loss between the predicted class probabilities and the class probabilities of the target image is calculated. The class probabilities of the target image are probability 1 (i.e., 100%) for images of the same tilt class as the target image and probability 0 (i.e., 0%) for images of any other tilt class.
[0087] Minimization of the loss is the goal of the ML model, and in step 403, the ML model parameters are updated based on the determined classification loss. Continuing with the example of a neural network, the update can be done by back-propagation, using gradient descent. Thus, the model parameters are updated in such a way that it should predict an angle as close as possible to the target image angle.
[0088] In step 404, it is determined whether the end condition is met. For example, the end condition may be that the classification loss reaches a threshold. If it is determined that the classification loss has not reached the threshold, the classification accuracy of the validation data may be improved, and the process returns to step 401, and further iterations are performed based on another image pair and using the updated model parameters. If the end condition is met, the training is complete.
[0089] Figure 5 An embodiment of a method 500 performed by a computer processing system is shown. The operations of method 500 may be performed, for example, by an instance of computer processing system 200. Method 500 is a method for determining image rotation of an image by applying a trained ML model.
[0090] In step 501, an input image is received, for example by a processor of a computer processing system, after retrieving the image data from a memory or receiving the image data through a communication channel. The input image may be, for example, an image taken by a digital camera, and may be slightly tilted or significantly tilted from a precise upright position.
[0091] In step 502, the computer processing system determines whether to correct the rotation of the image. If not, the method proceeds to step 506 - returning a zero rotation correction as the predicted angle for rotation correction. The effect of the determination of step 502 can be considered an initial filter for images that should be rotated and images that should not be rotated. The filter can be applied, for example, as part of automatic image processing, but can also be applied in response to a manual request to apply a trained ML model.
[0092] As background for step 502, the trained ML model looks for rotation information or clues in the image to determine a rotation prediction to bring the image to a precise upright position. However, for some images, this rotation information is either unclear or undefined. Step 502 adapts to them by trying to identify at least some of these images and not predict any rotation for them. Examples of images that can be filtered from the prediction process by step 502 may include: images of circularly symmetrical objects, such as some flood plates, flowers, and cups; images of textureless foregrounds, such as images of tiles or skies; images in which various objects are jumbled and therefore no reliable rotation information is available; images of textures without any clear rotation information, such as water waves, frosted tiles, sand, or dot patterns; and images of close-ups, such as close-ups of objects or faces.
[0093] Step 502 is performed by a trained classifier model. The model is trained in a supervised manner based on two classes of images: a) images whose rotation is defined, or in other words, images that are predetermined to ensure a "yes" answer to the determination at step 502, and b) images whose rotation is unknown or undefined, or in other words, images that are predetermined to ensure a no answer to the determination at step 502. In some embodiments, the model is a neural network. In some embodiments, the model is a convolutional neural network. In some embodiments, the classifier model is trained using a binary cross entropy loss, the purpose of which is to maximize the correct classification of the validation data.
[0094] In other embodiments, step 502 is omitted. In this case, all images can be processed to return the predicted angles, and the images can also be automatically rotated according to the predicted angles. In these and other embodiments, including embodiments that include step 502, the computer processing system can provide a mechanism for the user to review and accept or reject the changes.
[0095] If in step 502, the trained classifier model determines that the image should be corrected, the method proceeds to step 503. In step 503, the computer processing system applies the trained ML model. Figure 4 The method 400 described herein can be used to perform training of a trained ML model using a reference Figure 3 The method 300 described above may be used to generate one or more image pairs or another method that uses random rotation value selection to generate image pairs. The trained ML model generates a rotation prediction of the image, such as a predicted angle. Figure 4 As described, the trained ML model may have been trained based on a classification loss. Therefore, the generated rotation prediction can be considered as a rotation classification, or in other words, the predicted angle can be considered as an angle classification. Then, the method proceeds to step 504.
[0096] In step 504, the computer processing system determines whether to return or apply a rotation prediction. The effect of the determination of step 504, similar to step 502, can be viewed as a filter for images that should be rotated and images that should not be rotated. In various embodiments, the computer processing system can be configured or configurable through a settings interface to apply both filters, only one filter or the other of the filters, or neither filter.
[0097] The determination in step 504 is based on a determination of what class the rotation prediction is in. Determining that the rotation prediction is in one or more first classes causes the method to proceed to step 505, in which case the generated rotation prediction is returned and, in some embodiments, automatically applied without further user input. Determining that the rotation prediction is in one or more second classes different from the one or more first classes causes the method to proceed to step 506, where no rotation or zero rotation prediction is returned.
[0098] In a specific example, consistent with the examples previously described herein, rotation angles of plus or minus 15 degrees in increments of 0.1 degrees may be assigned to the various classes, and all rotation values outside of plus or minus 15 degrees may be assigned to a common class of an absolute value of 15 degrees. If the rotation prediction is any class associated with the plus or minus 15 degree range, step 504 may determine that the image is to be corrected by returning or applying the predicted angle in step 505. If the rotation prediction is in the class of an absolute value of 15 degrees, step 504 may determine that the image is not to be corrected by returning a zero rotation angle in step 506 or otherwise not applying a non-zero predicted angle.
[0099] While the previous description has rotation angles as classes, in other embodiments, the classes may be given any labels. For example, a class labeled "AA" may be associated with negative 15 degrees, class "AB" with negative 14.9 degrees, class "AC" with negative 14.8 degrees, and so on. The trained ML model will then determine the class, such as AB. The predicted rotation angle to be returned will then be determined by identifying the angle associated with class AB (in this case, negative 14.8 degrees).
[0100] To facilitate the training and application of ML models to determine classes for image rotation, image inputs to ML models for training or for image prediction may have square dimensions. For example, a CNN may require a fixed square dimension for input data, such as data defining pixels arranged in a square, such as 224x224 pixels, 320x320 pixels, or 480x480 pixels.
[0101] The square dimension input image may have been formed based on a non-square image, such as a rectangular image. Resizing the rotated image to an image of fixed square dimensions does not necessarily keep the edge orientation the same as the original image. For example, if the original rotated image is of portrait or landscape type, then by resizing to a square aspect ratio the orientation of all edges and lines in the image will be slightly shifted. Therefore, training a model on such square images without preserving the actual edge orientation may adversely affect the performance of the model.
[0102] Figure 6An embodiment of a method 600 performed by a computer processing system is shown. The operations of method 600 may be performed, for example, by an instance of computer processing system 200. Method 600 is a method for creating an input representing an image for an ML model.
[0103] In some embodiments, method 600 is similar to reference Figure 4 In particular, in step 401 of method 400, the existing model is applied to the Figure 6 In some embodiments, the method 600 is similar to the method 600 of reference Figure 5 In particular, in step 503 of method 500, the existing model is applied to the Figure 6 In some embodiments, method 600 is performed to generate inputs to an ML model during training of the ML learning model (e.g., according to method 400) and during use of the trained ML learning model (e.g., according to method 500).
[0104] Data defining an image is received in step 601. The data may define a rectangular image, either portrait or landscape oriented, or a square image, for example defined by pixel counts in the horizontal and vertical dimensions.
[0105] In step 602, the computer processing system determines whether the image is a portrait image, a landscape image, or a square image. When it is determined to be a portrait image, the process proceeds to step 603. When it is determined to be a landscape image, the process proceeds to step 604. When it is determined to be a square image, the process proceeds to step 605.
[0106] In step 603, three square images are cropped from the vertical image. The first image is cropped from the top of the image, the second image is cropped from the center of the image (i.e., the centroid of the square image coincides with the centroid of the vertical image), and the third image is cropped from the bottom of the image. The method then proceeds to step 606.
[0107] In step 604, three square images are cropped from the landscape image (the same number as in step 603). The first image is cropped from the left side of the image, the second image is cropped from the center of the image (i.e., the centroid of the x by x square image coincides with the centroid of the landscape image), and the third image is cropped from the right side of the image. The method then proceeds to step 606.
[0108] In step 605, a determination is made to use the same image three times to match the number of cropped images formed in steps 603 and 604. In some embodiments, this determination is implicit in the determination that the image is square in step 602, rather than a separate determination by the computer processing system. The method then proceeds to step 606.
[0109] Figure 7 An example of a vertical target training image (the image on the left), a rotated image with overlapping borders for cropping (the image in the center), and a set of three square cropped images (the images on the right) are shown. The three cropped images overlap at least with their neighboring images, and as shown in FIG. Figure 7 As shown, it can overlap with the other two cropped images. Cropping of the horizontal target training image can be performed equivalently, cropping the rotated image from the left, center, and right instead of from the top, center, and bottom.
[0110] In step 606, if the three square images from steps 603 to 605 do not have the required size to be provided to the ML model, the images are processed by the computer processing system to be enlarged to the required size or reduced to the required size, maintaining the aspect ratio. Since the images are all square, resizing them to a fixed square size preserves edge orientation information. For example, all images can be enlarged-reduced as needed to have a common size, such as x by x pixels, where x is 224, 320, or 480.
[0111] In step 607, the computer processing system determines or generates a feature vector for each of the three images obtained from step 606. As previously described herein, a feature vector for an image can be generated based on an image by a pre-trained convolutional neural network (CNN) model. 3D (three-dimensional) convolutional features are extracted from the last CNN layer, and the 3D convolutional features are converted to 1D (one-dimensional) feature vectors by calculating global average pooling (GAP). Feature vectors can be generated using the MobileNet V3 model, which is described in the paper "Searching for MobileNetV3" (reference number arXiv:1905.02244v5) by Howard et al. published by arXiv.org. Then, the method proceeds to step 607.
[0112] In step 608, a single vector is formed for the image. The single vector may be formed from the three feature vectors determined or generated in step 607 by concatenating the feature vectors. The order of concatenation is the same for each image processed according to method 600. The single vector resulting from the concatenation may be an input to an ML model representing a portrait, landscape, or square image.
[0113] Although Figure 6 Method 600 involves cropping three images from the received image, but in other embodiments, two images or four or more images are cropped, and in the case of square images, the images are used a corresponding number of times so that the single vector formed by the concatenation of the feature vectors has the same length.
[0114] Figure 8 A graphical representation of a machine learning architecture 800 is shown, which is configured to be trained to predict rotation values of an image based on a training image set, and once trained, predict rotation values of an image. Figure 8 The process for generating training images and for training the machine learning architecture is also schematically represented.
[0115] The machine learning architecture includes a pre-trained neural network 801 and a classification head 802. The pre-training of the neural network 801 is training for generating a feature vector for each input image in a plurality of input images 803. The input image 803 has a predetermined size, for example, 480 by 480 pixels, which is generated by a resizing process and a data enhancement process 804 applied to a square image 805 extracted from a rotated image 806. In some embodiments, the data enhancement process includes changing the color of the image by changing one or more of brightness, saturation, and contrast. It may also or alternatively include blurring the image. In some embodiments, the image may not be enhanced at all. The aforementioned enhancement operations may be randomly sampled together with their amounts / intensities, however, the same operations and the associated amounts / intensities corresponding to these operations will be applied to all square images 805. The rotated image 806 together with the target image 807 can all be part of a training image pair. The pre-trained neural network 801 may be the aforementioned MobileNet V3 model or another suitable model, and an example process for generating image pairs for training, extracting square images, and adjusting their sizes is also described herein.
[0116] For the three input images 803, three feature vectors are generated. For example, the feature vectors may each have a length of 960. These are concatenated into a single vector of length 2880 and input to the classification head 802. The classification head determines the class probabilities p1 to p m During training, the classification loss (given by Figure 8 The arrow CL in the figure indicates that the class probabilities p1 to p m and the known rotation between the rotated image 806 and the target image 807. Figure 4 Step 402 of FIG. 4 depicts an example process for determining the classification loss. During application of the trained architecture, the predicted rotations returned are those corresponding to the class probabilities p1 to p m The rotation with the highest probability.
[0117] Without limiting the foregoing disclosure, specific embodiments of the present disclosure are described by the following clauses.
[0118] Clause A1: A computer-implemented method for generating image pairs for training a machine learning model for image processing, the method comprising:
[0119] for each target training image of the plurality of target training images, forming at least one rotated image corresponding to the target training image, wherein each rotated image of the at least one rotated image is a version of the target training image rotated by a rotation value determined according to a random rotation selection process;
[0120] in:
[0121] Multiple target training images with target orientations for machine learning models;
[0122] The image pairs are formed by the target training image and the rotated image corresponding to the target training image, and wherein the method further comprises associating each image pair with a classification, the classification of the image pair corresponding to the rotation value or a discretized rotation value of the rotation value of the image pair.
[0123] Clause A2: The computer-implemented method of clause A1, further comprising:
[0124] A plurality of target training images are determined from the plurality of target images according to a random image selection process.
[0125] Clause A3: The computer-implemented method of clause A2, further comprising repeating the random selection process such that the number of images in the plurality of target training images is greater than the number of images in the plurality of target images.
[0126] Clause A4: A computer-implemented method as described in clause A2, wherein the first target training image forms part of a plurality of image pairs, each image pair in the plurality of image pairs having a different said rotated image.
[0127] Clause A5: The computer-implemented method of any of clauses A1 to A4, wherein the random rotation selection process is constrained to a set or range of selectable rotation values.
[0128] Clause A6: The computer-implemented method of clause A5, wherein the set or range of selectable rotation values represents clockwise or counterclockwise rotation values.
[0129] Clause A7: A computer-implemented method according to clause A5, wherein the set or range of optional rotation values represents the following clockwise or counterclockwise rotation values: a) a value of 25 degrees or less; or b) a value of 20 degrees or less; or c) a value of 15 degrees or less.
[0130] Clause A8: A computer-implemented method as described in any of clauses A5 to A7, wherein the random rotation selection process is a first random rotation selection process, and the method further comprises forming a plurality of additional image pairs in addition to the image pairs by a process comprising the steps of:
[0131] For each target training image in the plurality of target training images, determining at least one rotation value of the target training image according to a second random rotation selection process;
[0132] for each target training image of the plurality of target training images, forming at least one further rotated image corresponding to the target training image, wherein each further rotated image of the at least one further rotated image is a version of the target training image rotated by the rotation value determined according to the second random rotation selection process;
[0133] in:
[0134] A second random rotation selection process determines at least one rotation value outside the set or range of selectable rotation values;
[0135] The further image pairs are formed by the target training image and the further rotated image corresponding to the target training image, and wherein the method further comprises associating each further image pair with a classification, the classification distinguishing each of the further image pairs as a class from the image pair.
[0136] Clause B1: A computer-implemented method for training a machine learning model for image rotation, the method comprising:
[0137] For each image pair in the plurality of image pairs, including a target image representing a target rotational orientation and a rotated image having a tilt away from the target rotational orientation, wherein the tilt has a discretized tilt value and within a discretized tilt value set, the discretized tilt value set includes a plurality of different tilt values:
[0138] applying a machine learning model to the rotated image to determine a set of predicted class probabilities corresponding to a discretized set of tilt values;
[0139] determining a classification loss, wherein the classification loss is based on the tilt value and the set of predicted class probabilities;
[0140] Update the machine learning model based on the objective of minimizing the classification loss.
[0141] Clause B2: A method according to clause B1, wherein:
[0142] The step of applying the machine learning model to the rotated image to determine a set of predicted class probabilities corresponding to the set of discretized tilt values includes determining at least one additional predicted class probability that does not correspond to a discretized tilt value of the set of discretized tilt values; and
[0143] The classification loss is also based on at least one additional predicted class probability.
[0144] Clause B3: A method according to clause B2, wherein the set of discretized tilt values corresponds to a first range of tilt values, and wherein at least one additional predicted class probability corresponds to a range of tilt values outside the first range of tilt values.
[0145] Clause B4: A method according to clause B3, wherein the range of tilt values outside the first range of tilt values covers all possible tilt values outside the first range of tilt values.
[0146] Clause B5: A method according to clauses B2 to B4, wherein the classification loss is based solely on the tilt value, the set of predicted class probabilities and at least one additional predicted class probability.
[0147] Clause B6: A method according to clauses B1 to B5, wherein the classification loss is based only on the tilt value and the set of predicted class probabilities
[0148] Clause B7: The method according to any one of clauses B1 to B5, further comprising generating a plurality of image pairs according to the method according to any one of clauses A1 to A8.
[0149] Clause B8: A method according to any one of clauses B1 to B7, wherein the plurality of image pairs comprises or consists of both image pairs generated according to the method according to clause A8 and further image pairs.
[0150] Item C1: A computer-implemented method comprising generating a predicted rotation angle of an image by applying a trained machine learning model running on a computer processing system to the image, wherein the trained machine learning model is trained according to a method described in any one of Items A1 to A8 or Items B1 to B8.
[0151] Clause C2: The method of clause C1, further comprising rotating the image by a predicted rotation angle via a computer processing system to generate a rotated image.
[0152] Item D1: A computer-implemented method for receiving data defining an image and determining and returning a predicted rotation value for the image comprises: applying a trained machine learning model to the image by a computer processing system, the trained machine learning model determining a class of the image, wherein the class is one of a plurality of classes defined by the machine learning model, wherein each of the plurality of classes is or is associated with a rotation value, and wherein the rotation value is the predicted rotation value of the image.
[0153] Item D2: The method described in Item D1 further includes determining, before applying the trained machine learning model, that the image is an image to which the trained machine learning model is to be applied, wherein the determination includes applying, by a computer processing system, another trained machine learning model to the image, wherein the other trained machine learning model is a classifier model trained to determine whether the image contains rotation information for determining the predicted rotation value.
[0154] Clause D3: A method according to clause D1 or clause D2, wherein, in addition to multiple classes, the machine learning model also defines at least one additional class, and wherein the method also includes determining by a computer processing system after applying the trained machine learning model: the determined class is one of the multiple classes, rather than the additional class.
[0155] Clause D4: A method according to any one of clauses D1 to D3, wherein the trained machine learning model is trained according to a training process comprising a method according to any one of clauses A1 to A8 or any one of clauses B1 to B8.
[0156] Clause E1: A computer-implemented method of providing input to a machine learning model for images, the method comprising:
[0157] dividing the image into a plurality of images, including at least a first image corresponding to a first portion of the image and a second image corresponding to a second portion of the image, the second portion being different from the first portion of the image;
[0158] forming a first eigenvector of the first image and a second eigenvector of the second image; and
[0159] The first feature vector and the second feature vector are concatenated into a single vector, and the single vector is provided as input to the machine learning model.
[0160] Clause E2: A method as described in clause El, wherein dividing the image into a plurality of images divides the image into at least three images, the at least three images being formed by respective portions of the image overlapping with at least their adjacent images.
[0161] Clause E3: A method as described in clause E2, wherein each of the at least three images is formed by a respective portion of the image that overlaps with each of the other images of the at least three images.
[0162] Clause E4: The method of clause E2 or clause E3, wherein dividing the image into a plurality of images divides the image into three images.
[0163] Clause E5: A method according to any of clauses E1 to E4, wherein providing the single vector as input to the machine learning model is performed as part of training the machine learning model.
[0164] Item E6: A method according to Item E5, wherein the image is a rotated version of a target image, the rotated version of the target image is the target image tilted by a known rotation amount, and wherein the machine learning model determines a predicted rotation and has an objective minimization of an error based on the predicted rotation and the known rotation.
[0165] Clause E7: The method of clause E6, wherein the error is a classification loss.
[0166] Clause E8: A method according to any one of clauses E1 to E7, wherein the machine learning model is a trained machine learning model and the single vector is provided as input to the machine learning model as part of image processing of the image.
[0167] Clause E9: The method according to any one of clauses E1 to E7 further includes, before dividing, determining that the image is a rectangular longitudinal image, and wherein dividing the image includes dividing the rectangular longitudinal image into two or more square images based on the determination that the image is a rectangular longitudinal image.
[0168] Clause E10: The method according to any one of clauses E1 to E7, further comprising, before dividing, determining that the image is a rectangular horizontal image, and wherein dividing the image comprises dividing the rectangular horizontal image into two or more square images based on the determination that the image is a rectangular horizontal image.
[0169] Clause E11: A method according to any one of E1 to E10, wherein:
[0170] Divide the image into multiple images, divide the image into N images;
[0171] The input is a first input, and the method further includes providing a second input to the machine learning model for an additional image different from the first image and the second image, wherein the additional image is a square image and the second input is a cascade of N copies of the feature vector of the second image.
[0172] Clause E12: A method according to any one of clauses E1 to E11, wherein each of the feature vectors is formed by a pre-trained convolutional neural network model, and wherein the pre-trained convolutional neural network model is different from the machine learning model.
[0173] Clause E13: A method according to any one of clauses E1 to E12, wherein the machine learning model is a multilayer perceptron network.
[0174] Clause E14: A method according to clause E13, wherein the training of the machine learning model is a training method according to any one of clauses B1 to B8.
[0175] Clause E15: A method according to clause E14, wherein the image processing of the image comprises a method according to any one of clauses D1 to D4.
[0176] Throughout the specification, unless the context clearly requires otherwise, the terms "first," "second," and "third" are intended to refer to individual instances of the mentioned items and are not intended to require any particular ordering in time, space, or otherwise.
[0177] It will be understood that the invention disclosed and defined in this specification extends to alternative combinations of two or more of the individual features mentioned or evident from the text or drawings. All of these different combinations constitute various alternative aspects of the invention.
Claims
1. A computer-implemented method for training a machine learning model for image rotation, the method comprising: For each image pair in a plurality of image pairs, comprising a target image representing a target rotational orientation and a rotated image having a tilt away from the target rotational orientation, wherein the tilt has discretized tilt values and is within a discretized tilt value set, the discretized tilt value set comprising a plurality of different tilt values: applying a machine learning model to the rotated image to determine a set of predicted class probabilities corresponding to the set of discretized tilt values; determining a classification loss, wherein the classification loss is based on the tilt value and the set of predicted class probabilities; The machine learning model is updated based on the objective of minimizing the classification loss.
2. The method according to claim 1, wherein: The step of applying a machine learning model to the rotated image to determine a set of predicted class probabilities corresponding to the set of discretized tilt values includes determining at least one additional predicted class probability that does not correspond to a discretized tilt value of the set of discretized tilt values; and The classification loss is also based on the at least one additional predicted class probability.
3. The method according to claim 2, wherein: The set of discretized tilt values corresponds to a first range of tilt values, and wherein the at least one further predicted class probability corresponds to a range of tilt values outside the first range of tilt values.
4. The method according to claim 3, wherein: The tilt value range outside the first tilt value range covers all possible tilt values outside the first tilt value range.
5. The method according to claim 2, wherein: The classification loss is based solely on the tilt value, the set of predicted class probabilities, and the at least one additional predicted class probability.
6. The method according to claim 1, wherein The classification loss is based only on the tilt value and the set of predicted class probabilities. The method of claim 1 , further comprising generating the plurality of image pairs.
8. The method according to claim 1, wherein The minimum quantization step size of the discretized tilt value set corresponds to a tilt of at least 0.1 degrees.
9. The method according to claim 1, wherein The quantization step size of the discretized tilt value set is non-uniform.
10. The method according to claim 9, wherein: The non-uniform quantization step size provides a first density of discretized values for a lower range of tilt values and a second density of discretized values for a higher range of tilt values, and wherein the first density is higher than the second density.
11. The method according to claim 1, wherein The plurality of different tilt values correspond to angles within a range, and wherein the range is between plus or minus 10 degrees, inclusive, and plus or minus 25 degrees, inclusive.
12. A computer-implemented method for receiving data defining an image and determining and returning a predicted rotation value for the image, the method comprising: A trained machine learning model is applied to the image by a computer processing system, the trained machine learning model determining a class of the image, wherein the class is one of a plurality of classes defined by the machine learning model, wherein each of the plurality of classes is or is associated with a rotation value, and wherein the rotation value is the predicted rotation value of the image.
13. The method of claim 12, further comprising determining, before applying the trained machine learning model, that the image is an image to which the trained machine learning model is to be applied, wherein The determining includes applying, by the computer processing system, an additional trained machine learning model to the image, wherein the additional trained machine learning model is a classifier model trained to determine whether the image contains rotation information for determining the predicted rotation value.
14. The method according to claim 12, wherein: The machine learning model defines at least one additional class in addition to the plurality of classes, and wherein the method further comprises determining, by the computer processing system after applying the trained machine learning model, that the determined class is one of the plurality of classes other than the additional class.
15. The method according to claim 12, wherein: The plurality of classes form a set of discretized rotation values having a minimum quantization step size corresponding to a rotation of at least 0.1 degrees.
16. The method according to claim 12, wherein: The plurality of classes form a discretized rotation value set, and wherein a quantization step size of the discretized tilt value set is non-uniform.
17. The method according to claim 16, wherein The non-uniform quantization step size provides a first density of discretized values for a lower range of tilt values and a second density of discretized values for a higher range of tilt values, and wherein the first density is higher than the second density.
18. The method according to claim 12, wherein: The plurality of class definitions correspond to rotation values corresponding to angles within a range, and wherein the range is at least plus or minus 10 degrees, inclusive, and at most plus or minus 25 degrees, inclusive.
19. The method according to claim 12, wherein: The trained machine learning model is trained according to a process comprising the following steps: For each image pair in the plurality of image pairs, comprising a target image representing a target rotational orientation and a rotated image having a rotation away from the target rotational orientation, wherein the rotation has a rotation value aligned with one of the plurality of classes: applying a machine learning model to the rotated image to determine a set of predicted class probabilities corresponding to the plurality of classes; determining a classification loss, wherein the classification loss is based on the rotation values and the set of predicted class probabilities; The machine learning model is updated based on the objective of minimizing the classification loss.
20. A non-transitory computer-readable storage device storing instructions for a computer processing system, wherein: The instructions, when executed by the computer processing system, cause the computer processing system to perform the method of claim 12 .
