Vision transformer

Vision transformer

A vision transformer (ViT) is a transformer designed for computer vision. A ViT decomposes an input image into a series of patches (rather than text into tokens), serializes each patch into a vector, and maps it to a smaller dimension with a single matrix multiplication. These vector embeddings are then processed by a transformer encoder as if they were token embeddings. ViTs were designed as alternatives to convolutional neural networks (CNNs) in computer vision applications. They have different inductive biases, training stability, and data efficiency. Compared to CNNs, ViTs are less data efficient, but have higher capacity. Some of the largest modern computer vision models are ViTs, such as one with 22B parameters. Subsequent to its publication, many variants were proposed, with hybrid architectures with both features of ViTs and CNNs. ViTs have found application in image recognition, image segmentation, weather prediction, and autonomous driving. == History == Transformers were introduced in Attention Is All You Need (2017), and have found widespread use in natural language processing. A 2019 paper applied ideas from the Transformer to computer vision. Specifically, they started with a ResNet, a standard convolutional neural network used for computer vision, and replaced all convolutional kernels by the self-attention mechanism found in a Transformer. It resulted in superior performance. However, it is not a Vision Transformer. In 2020, an encoder-only Transformer was adapted for computer vision, yielding the ViT, which reached state of the art in image classification, overcoming the previous dominance of CNN. The masked autoencoder (2022) extended ViT to work with unsupervised training. The vision transformer and the masked autoencoder, in turn, stimulated new developments in convolutional neural networks. Subsequently, there was cross-fertilization between the previous CNN approach and the ViT approach. In 2021, some important variants of the Vision Transformers were proposed. These variants are mainly intended to be more efficient, more accurate or better suited to a specific domain. Two studies improved efficiency and robustness of ViT by adding a CNN as a preprocessor. The Swin Transformer achieved state-of-the-art results on some object detection datasets such as COCO, by using convolution-like sliding windows of attention mechanism, and the pyramid process in classical computer vision. == Overview == The basic architecture, used by the original 2020 paper, is as follows. In summary, it is a BERT-like encoder-only Transformer. The input image is of type R H × W × C {\displaystyle \mathbb {R} ^{H\times W\times C}} , where H , W , C {\displaystyle H,W,C} are height, width, channel (RGB). It is then split into square-shaped patches of type R P × P × C {\displaystyle \mathbb {R} ^{P\times P\times C}} . For each patch, the patch is pushed through a linear operator, to obtain a vector ("patch embedding"). The position of the patch is also transformed into a vector by "position encoding" (the paper tried no embedding, 1D embedding, 2D embedding, and relative embedding: 1D was adopted). The two vectors are added, then pushed through several Transformer encoders. The attention mechanism in a ViT repeatedly transforms representation vectors of image patches, incorporating more and more semantic relations between image patches in an image. This is analogous to how in natural language processing, as representation vectors flow through a transformer, they incorporate more and more semantic relations between words, from syntax to semantics. The above architecture turns an image into a sequence of vector representations. To use these for downstream applications, an additional head needs to be trained to interpret them. For example, to use it for classification, one can add a shallow MLP on top of it that outputs a probability distribution over classes. The original paper uses a linear-GeLU-linear-softmax network. == Variants == === Original ViT === The original ViT was an encoder-only Transformer supervise-trained to predict the image label from the patches of the image. As in the case of BERT, it uses a special token in the input side, and the corresponding output vector is used as the only input of the final output MLP head. The special token is an architectural hack to allow the model to compress all information relevant for predicting the image label into one vector. Transformers found their initial applications in natural language processing tasks, as demonstrated by language models such as BERT and GPT-3. By contrast the typical image processing system uses a convolutional neural network (CNN). Well-known projects include Xception, ResNet, EfficientNet, DenseNet, and Inception. Transformers measure the relationships between pairs of input tokens (words in the case of text strings), termed attention. The cost is quadratic in the number of tokens. For images, the basic unit of analysis is the pixel. However, computing relationships for every pixel pair in a typical image is prohibitive in terms of memory and computation. Instead, ViT computes relationships among pixels in various small sections of the image (e.g., 16x16 pixels), at a drastically reduced cost. The sections (with positional embeddings) are placed in a sequence. The embeddings are learnable vectors. Each section is arranged into a linear sequence and multiplied by the embedding matrix. The result, with the position embedding is fed to the transformer. === Architectural improvements === ==== Pooling ==== After the ViT processes an image, it produces some embedding vectors. These must be converted to a single class probability prediction by some kind of network. In the original ViT and Masked Autoencoder, they used a dummy [CLS] token, in emulation of the BERT language model. The output at [CLS] is the classification token, which is then processed by a LayerNorm-feedforward-softmax module into a probability distribution. Global average pooling (GAP) does not use the dummy token, but simply takes the average of all output tokens as the classification token. It was mentioned in the original ViT as being equally good. Multihead attention pooling (MAP) applies a multiheaded attention block to pooling. Specifically, it takes as input a list of vectors x 1 , x 2 , … , x n {\displaystyle x_{1},x_{2},\dots ,x_{n}} , which might be thought of as the output vectors of a layer of a ViT. The output from MAP is M u l t i h e a d e d A t t e n t i o n ( Q , V , V ) {\displaystyle \mathrm {MultiheadedAttention} (Q,V,V)} , where q {\displaystyle q} is a trainable query vector, and V {\displaystyle V} is the matrix with rows being x 1 , x 2 , … , x n {\displaystyle x_{1},x_{2},\dots ,x_{n}} . This was first proposed in the Set Transformer architecture. Later papers demonstrated that GAP and MAP both perform better than BERT-like pooling. A variant of MAP was proposed as class attention, which applies MAP, then feedforward, then MAP again. Re-attention was proposed to allow training deep ViT. It changes the multiheaded attention module. === Masked Autoencoder === The Masked Autoencoder took inspiration from denoising autoencoders and context encoders. It has two ViTs put end-to-end. The first one ("encoder") takes in image patches with positional encoding, and outputs vectors representing each patch. The second one (called "decoder", even though it is still an encoder-only Transformer) takes in vectors with positional encoding and outputs image patches again. ==== Training ==== During training, input images (224px x 224 px in the original implementation) are split along a designated number of lines on each axis, producing image patches. A certain percentage of patches are selected to be masked out by mask tokens, while all others are retained in the image. The network is tasked with reconstructing the image from the remaining unmasked patches. Mask tokens in the original implementation are learnable vector quantities. A linear projection with positional embeddings is then applied to the vector of unmasked patches. Experiments varying mask ratio on networks trained on the ImageNet-1K dataset found 75% mask ratios achieved high performance on both finetuning and linear-probing of the encoder's latent space. The MAE processes only unmasked patches during training, increasing the efficiency of data processing in the encoder and lowering the memory usage of the transformer. A less computationally-intensive ViT is used for the decoder in the original implementation of the MAE. Masked patches are added back to the output of the encoder block as mask tokens and both are fed into the decoder. A reconstruction loss is computed for the masked patches to assess network performance. ==== Prediction ==== In prediction, the decoder architecture is discarded entirely. The input image is split into patches by the same algorithm as in training, but no patches are masked out. A linear projection wi

Bigram

A bigram or digram is a sequence of two adjacent elements from a string of tokens, which are typically letters, syllables, or words. A bigram is an n-gram for n=2. The frequency distribution of every bigram in a string is commonly used for simple statistical analysis of text in many applications, including in computational linguistics, cryptography, and speech recognition. Gappy bigrams or skipping bigrams are word pairs which allow gaps (perhaps avoiding connecting words, or allowing some simulation of dependencies, as in a dependency grammar). == Applications == Bigrams, along with other n-grams, are used in most successful language models for speech recognition. Bigram frequency attacks can be used in cryptography to solve cryptograms. See frequency analysis. Bigram frequency is one approach to statistical language identification. Some activities in logology or recreational linguistics involve bigrams. These include attempts to find English words beginning with every possible bigram, or words containing a string of repeated bigrams, such as logogogue. == Bigram frequency in the English language == The frequency of the most common letter bigrams in a large English corpus is: th 3.56% of 1.17% io 0.83% he 3.07% ed 1.17% le 0.83% in 2.43% is 1.13% ve 0.83% er 2.05% it 1.12% co 0.79% an 1.99% al 1.09% me 0.79% re 1.85% ar 1.07% de 0.76% on 1.76% st 1.05% hi 0.76% at 1.49% to 1.05% ri 0.73% en 1.45% nt 1.04% ro 0.73% nd 1.35% ng 0.95% ic 0.70% ti 1.34% se 0.93% ne 0.69% es 1.34% ha 0.93% ea 0.69% or 1.28% as 0.87% ra 0.69% te 1.20% ou 0.87% ce 0.65%

Fuzzy pay-off method for real option valuation

The fuzzy pay-off method for real option valuation (FPOM or pay-off method) is a method for valuing real options, developed by Mikael Collan, Robert Fullér, and József Mezei; and published in 2009. It is based on the use of fuzzy logic and fuzzy numbers for the creation of the possible pay-off distribution of a project (real option). The structure of the method is similar to the probability theory based Datar–Mathews method for real option valuation, but the method is not based on probability theory and uses fuzzy numbers and possibility theory in framing the real option valuation problem. == Method == The Fuzzy pay-off method derives the real option value from a pay-off distribution that is created by using three or four cash-flow scenarios (most often created by an expert or a group of experts). The pay-off distribution is created simply by assigning each of the three cash-flow scenarios a corresponding definition with regards to a fuzzy number (triangular fuzzy number for three scenarios and a trapezoidal fuzzy number for four scenarios). This means that the pay-off distribution is created without any simulation whatsoever. This makes the procedure easy and transparent. The scenarios used are a minimum possible scenario (the lowest possible outcome), the maximum possible scenario (the highest possible outcome) and a best estimate (most likely to happen scenario) that is mapped as a fully possible scenario with a full degree of membership in the set of possible outcomes, or in the case of four scenarios used - two best estimate scenarios that are the upper and lower limit of the interval that is assigned a full degree of membership in the set of possible outcomes. The main observations that lie behind the model for deriving the real option value are the following: The fuzzy NPV of a project is (equal to) the pay-off distribution of a project value that is calculated with fuzzy numbers. The mean value of the positive values of the fuzzy NPV is the "possibilistic" mean value of the positive fuzzy NPV values. Real option value, ROV, calculated from the fuzzy NPV is the "possibilistic" mean value of the positive fuzzy NPV values multiplied with the positive area of the fuzzy NPV over the total area of the fuzzy NPV. The real option formula can then be written simply as: R O V = A ( P o s ) A ( P o s ) + A ( N e g ) × E [ A + ] {\displaystyle \mathrm {ROV} ={\frac {A(\mathrm {Pos} )}{A(\mathrm {Pos} )+A(\mathrm {Neg} )}}\times E[A_{+}]} where A(Pos) is the area of the positive part of the fuzzy distribution, A(Neg) is the area of the negative part of the fuzzy distribution, and E[A+] is the mean value of the positive part of the distribution. It can be seen that when the distribution is totally positive, the real options value reduces to the expected (mean) value, E[A+]. As can be seen, the real option value can be derived directly from the fuzzy NPV, without simulation. At the same time, simulation is not an absolutely necessary step in the Datar–Mathews method, so the two methods are not very different in that respect. But what is totally different is that the Datar–Mathews method is based on probability theory and as such has a very different foundation from the pay-off method that is based on possibility theory: the way that the two models treat uncertainty is fundamentally different. == Use of the method == The pay-off method for real option valuation is very easy to use compared to the other real option valuation methods and it can be used with the most commonly used spreadsheet software without any add-ins. The method is useful in analyses for decision making regarding investments that have an uncertain future, and especially so if the underlying data is in the form of cash-flow scenarios. The method is less useful if optimal timing is the objective. The method is flexible and accommodates easily both one-stage investments and multi-stage investments (compound real options). The method has been taken into use in some large international industrial companies for the valuation of research and development projects and portfolios. In these analyses triangular fuzzy numbers are used. Other uses of the method so far are, for example, R&D project valuation IPR valuation, valuation of M&A targets and expected synergies, valuation and optimization of M&A strategies, valuation of area development (construction) projects, valuation of large industrial real investments. The use of the pay-off method is lately taught within the larger framework of real options, for example at the Lappeenranta University of Technology and at the Tampere University of Technology in Finland.

Blended artificial intelligence

Blended artificial intelligence (blended AI) refers to the blending of different artificial intelligence techniques or approaches to achieve more robust and practical solutions. It involves integrating multiple AI models, algorithms, and technologies to leverage their respective strengths and compensate for their weaknesses. == Background == In the context of machine learning, blended AI can involve using different types of models, such as generative AI, decision trees, neural networks, and support vector machines. By combining their results, predictions are more accurate and reliable. This blending of models can be done through techniques like ensemble learning, where multiple models are trained independently and their predictions are combined to make a final decision. Blended AI can also involve combining different AI techniques or technologies, such as natural language processing, computer vision, and expert systems, to tackle complex problems that require a multi-dimensional approach. For example, in a sales scenario AI could be used for lead generation and gathering information from social media such as LinkedIn posts, or understanding a prospect's hobbies and interests. Another blended AI could achieve customer profiling including past interactions and purchasing habits, by them, their industry and growth areas. Blended AI could be used to do predictive analytics to look at historical sales data, market trends, and external factors to generate accurate sales forecasts. This method is critical to gauge and increase "efficiency, revenue, and productivity". Lastly, another could integrate all the information into the CRM to build and maintain better prospect and customer profiles. Blended AI aims to leverage the strengths of different AI techniques and technologies, allowing them to complement each other and create more powerful and comprehensive AI solutions. By combining multiple approaches, blended AI aims to achieve better performance, higher accuracy, improved robustness, and enhanced capabilities in solving diverse and challenging problems.

Fuzzy classification

Fuzzy classification is the process of grouping elements into fuzzy sets whose membership functions are defined by the truth value of a fuzzy propositional function. A fuzzy propositional function is analogous to an expression containing one or more variables, such that when values are assigned to these variables, the expression becomes a fuzzy proposition. Accordingly, fuzzy classification is the process of grouping individuals having the same characteristics into a fuzzy set. A fuzzy classification corresponds to a membership function μ C ~ : P F ~ × U → T ~ {\textstyle \mu _{\tilde {C}}:{\tilde {PF}}\times U\to {\tilde {T}}} that indicates the degree to which an individual i ∈ U {\textstyle i\in U} is a member of the fuzzy class C ~ {\textstyle {\tilde {C}}} , given its fuzzy classification predicate Π ~ C ~ ∈ P F ~ {\textstyle {\tilde {\Pi }}_{\tilde {C}}\in {\tilde {PF}}} . Here, T ~ {\textstyle {\tilde {T}}} is the set of fuzzy truth values, i.e., the unit interval [ 0 , 1 ] {\textstyle [0,1]} . The fuzzy classification predicate Π ~ C ~ ( i ) {\textstyle {\tilde {\Pi }}_{\tilde {C}}(i)} corresponds to the fuzzy restriction " i {\textstyle i} is a member of C ~ {\textstyle {\tilde {C}}} ". == Classification == Intuitively, a class is a set that is defined by a certain property, and all objects having that property are elements of that class. The process of classification evaluates for a given set of objects whether they fulfill the classification property, and consequentially are a member of the corresponding class. However, this intuitive concept has some logical subtleties that need clarification. A class logic is a logical system which supports set construction using logical predicates with the class operator { ⋅ | ⋅ } {\textstyle \{\cdot |\cdot \}} . A class C = { i | Π ( i ) } {\displaystyle C=\{i|\Pi (i)\}} is defined as a set C of individuals i satisfying a classification predicate Π which is a propositional function. The domain of the class operator { .| .} is the set of variables V and the set of propositional functions PF, and the range is the powerset of this universe P(U) that is, the set of possible subsets: { ⋅ | ⋅ } : V × P F → P ( U ) {\displaystyle \{\cdot |\cdot \}:V\times PF\rightarrow P(U)} Here is an explanation of the logical elements that constitute this definition: An individual is a real object of reference. A universe of discourse is the set of all possible individuals considered. A variable V :→ R {\textstyle V:\rightarrow R} is a function which maps into a predefined range R without any given function arguments: a zero-place function. A propositional function is "an expression containing one or more undetermined constituents, such that, when values are assigned to these constituents, the expression becomes a proposition". In contrast, classification is the process of grouping individuals having the same characteristics into a set. A classification corresponds to a membership function μ that indicates whether an individual is a member of a class, given its classification predicate Π. μ : P F × U → T {\displaystyle \mu :PF\times U\rightarrow T} The membership function maps from the set of propositional functions PF and the universe of discourse U into the set of truth values T. The membership μ of individual i in Class C is defined by the truth value τ of the classification predicate Π. μ C ( i ) := τ ( Π ( i ) ) {\displaystyle \mu C(i):=\tau (\Pi (i))} In classical logic the truth values are certain. Therefore a classification is crisp, since the truth values are either exactly true or exactly false.

U-Net

U-Net is a convolutional neural network that was developed for image segmentation. The network is based on a fully convolutional neural network whose architecture was modified and extended to work with fewer training images and to yield more precise segmentation. Segmentation of a 512 × 512 image takes less than a second on a modern (2015) GPU using the U-Net architecture. The U-Net architecture has also been employed in diffusion models for iterative image denoising. This technology underlies many modern image generation models, such as DALL-E, Midjourney, and Stable Diffusion. U-Net is also being explored for language models. Tokenization is not a separate step, allowing the model to more easily understand spelling and concurrently vectorizing / tokenizing higher level concepts. == Description == The U-Net architecture stems from the so-called "fully convolutional network". The main idea is to supplement a usual contracting network by successive layers, where pooling operations are replaced by upsampling operators. Hence these layers increase the resolution of the output. A successive convolutional layer can then learn to assemble a precise output based on this information. One important modification in U-Net is that there are a large number of feature channels in the upsampling part, which allow the network to propagate context information to higher resolution layers. As a consequence, the expansive path is more or less symmetric to the contracting part, and yields a u-shaped architecture. The network only uses the valid part of each convolution without any fully connected layers. To predict the pixels in the border region of the image, the missing context is extrapolated by mirroring the input image. This tiling strategy is important to apply the network to large images, since otherwise the resolution would be limited by the GPU memory. Recently, there had also been an interest in receptive field based U-Net models for medical image segmentation. == Network architecture == The network consists of a contracting path and an expansive path, which gives it the u-shaped architecture. The contracting path is a typical convolutional network that consists of repeated application of convolutions, each followed by a rectified linear unit (ReLU) and a max pooling operation. During the contraction, the spatial information is reduced while feature information is increased. The expansive pathway combines the feature and spatial information through a sequence of up-convolutions and concatenations with high-resolution features from the contracting path. == Applications == There are many applications of U-Net in biomedical image segmentation, such as brain image segmentation (''BRATS'') and liver image segmentation ("siliver07") as well as protein binding site prediction. U-Net implementations have also found use in the physical sciences, for example in the analysis of micrographs of materials. Variations of the U-Net have also been applied for medical image reconstruction. Here are some variants and applications of U-Net as follows: Pixel-wise regression using U-Net and its application on pansharpening; 3D U-Net: Learning Dense Volumetric Segmentation from Sparse Annotation; TernausNet: U-Net with VGG11 Encoder Pre-Trained on ImageNet for Image Segmentation. Image-to-image translation to estimate fluorescent stains In binding site prediction of protein structure. == History == U-Net was created by Olaf Ronneberger, Philipp Fischer, Thomas Brox in 2015 and reported in the paper "U-Net: Convolutional Networks for Biomedical Image Segmentation". It is an improvement and development of FCN: Evan Shelhamer, Jonathan Long, Trevor Darrell (2014). "Fully convolutional networks for semantic segmentation".

Tempos Modernos

Tempos Modernos (English: Modern Times) is a Brazilian telenovela produced and broadcast by TV Globo. It premiered on 11 January 2010, replacing Caras & Bocas, and ended on 16 July 2010, replaced by Ti Ti Ti. The series is written by Bosco Brasil, with the collaboration of Izabel de Oliveira, Maria Elisa Berredo, Mário Teixeira and Patrícia Moretzsohn. It stars Fernanda Vasconcellos, Thiago Rodrigues, Antônio Fagundes, and Eliane Giardini. Priscila Fantin, Danton Mello, Marcos Caruso, Regiane Alves, Vivianne Pasmanter, Otávio Muller, Felipe Camargo, and Malu Galli also star in main roles. == Cast == Fernanda Vasconcellos as Cornélia Cordeiro Santos Reis "Nelinha" Thiago Rodrigues as José Carlos Pimenta Cordeiro "Zeca" Antônio Fagundes as Leal Cordeiro Eliane Giardini as Hélia Pimenta Priscila Fantin as Nara Nolasco Marcos Caruso as Otto Niemann Vivianne Pasmanter as Regiane Cordeiro Mourão Regiane Alves as Goretti Cordeiro Bodanski "Gô" Otávio Muller as Altemir Assunção da Paz Bodanski (Bodanski) Felipe Camargo as Vinícius Porto de Mello "Portinho" Danton Mello as Renato Vieira de Mattos Alessandra Maestrini as Benedita Kusnezov Piñon "Dita'" Leonardo Medeiros as Ramon Piñon Guilherme Weber as Albano Mourão Grazi Massafera as Deodora Madureira Niemann / N. Anne Malu Galli as Iolanda Paranhos Guilherme Leicam as Led Piñon Aline Peixoto as Jannis Piñon Caroline Abras as Katrina João Baldasserini as Túlio Osório Débora Duarte as Tertuliana "Tertu" Otávio Augusto as Faustaço Lumbriga Selma Egrei as Tamara Palumbo Genézio de Barros as Pasquale Paula Possani as Maureen Lobianco Ricardo Blat as Fidélio Pascoal da Conceição as Zuppo Tuna Dwek as Justine Jairo Mattos as Gaulês "Jean Paul" Luciana Borghi as Bárbara Lee Cris Vianna as Tita Bicalho Edmilson Barros as Lindomar Mariano Assunção Cláudia Missura as Lavínia Palumbo Victor Pecoraro as Ricardo Maurício "Maurição" Naruna Costa as Dolores Damasceno Antônio Fragoso as Zapata Fabrício Boliveira as Nabuco Mota Eliana Pittman as Miranda Paranhos Márcio Seixas as Frankenstein "Frank" (voice) Joana Lerner as Heloísa "Helô" Darlan Cunha as João Carlos Paranhos "Joca" Janaína Ávila as Milena Morgado Anderson Lau as Okuda Alexandra Martins as Dulcinólia Lumbriga "Duba" Paulo Leal de Melo as Raulzão "Ducha Fria" Cássio Inácio as Tartana Gilberto Miranda as Madrugadinha Rafa Martins as Max do Cavaco Isabel Lobo as Thaís Trancoso Alexandre Cioletti as Valvênio Xandy Britto as Nelsinho Pallotti Polliana Aleixo as Maria Eunice Cordeiro Bodanski Ana Karolina Lannes as Maria Eugênia Cordeiro Bodanski Rebeca Orestein as Maria Helena Cordeiro Bodanski Jenifer de Oliveira Andrade as Maria Clara Cordeiro Bodanski