# Personality Type Based on Myers-Briggs Type Indicator with Text Posting
Style by using Traditional and Deep Learning

Sakdipat Ontoum12, Jonathan H. Chan12  1Computer Science Program, School of
Information Technology  2Innovative Cognitive Computing (IC2) Research Center
King Mongkut’s University of Technology Thonburi  Bangmod, Thung-Khru,
Bangkok, Thailand

###### Abstract

The term “personality” may be expressed in terms of the individual differences
in characteristics pattern of thinking, feeling, and behavior. This work
presents several machine learning techniques including “Naive Bayes”, “Support
Vector Machines”, and “Recurrent Neural Networks” to predict people
personality from text based on “Myers-Briggs Type Indicator (MBTI)”.
Furthermore, this project applies “CRISP-DM”, which stands for “Cross-Industry
Standard Process for Data Mining”, to guide the learning process. Since,
“CRISP-DM” is kind of iterative development, we have adopted it with agile
methodology, which is a rapid iterative software development method, in order
to reduce the development cycle to be minimal.

###### Index Terms:

Machine Learning; Naive Bayes; Support Vector Machines; Recurrent Neural
Networks; Myers-Briggs Type Indicator (MBTI); Personality Prediction; CRoss
Industry Standard Process for Data Mining (CRISP-DM); Agile Methodology

##  I Introduction

The “Myers-Briggs Type Indicator (MBTI)” is an approach that reflects and
identifies a person’s character. According to [2], a person’s personality is
described as a group of characteristics that describe the likelihood of a
person’s unique behavior, feelings, and thoughts. These characteristics of a
person evolve and may differ in different contexts. In other words,
personality is a collection of the traits that contribute to an individual’s
distinct personality. Nowadays, many different types of personality models are
utilized to characterize personalities, such as the “Big Five Personality
Traits model” [3], “VIA Classification of Character Strengths” [4], “Myers-
Briggs Type Indicator (MBTI)” model [5,6], and “Jung’s Theory of Personality
Type models”. It has been discovered that “MBTI” is more powerful because it
has a broader application in a variety of disciplines. However, it has a few
reliability and validity concerns. We chose the “MBTI” personality model for
this study because of its popularity and the potential for utilizing it in a
variety of fields.

Machine learning is a method that researchers frequently employ to predict
personality. They can utilize machine learning to learn personality patterns
because it can be utilized to learn historical data and predict future data
[1, 30]. In psychology science, such an application exists as a tool for
personality evaluation and prediction [30]. The development of machine
learning algorithm-based personality prediction technologies has become more
important to businesses and recruiters for choosing the best candidates [30].

Nowadays, both natural language processing and social science communities have
expressed an increasing interest in automatic personality prediction from
social networks [9,30]. Social networks can also be utilized to investigate
people’s personalities. A social networking post can be made in a variety of
ways, including by utilizing an image, a URL link, and music. Unlike
traditional personality tests, which have mostly been utilized in human
resources management, counseling, and clinical psychology. The application of
automatic personality prediction from social networks is much larger. Dating
websites and social media marketing are two examples [10, 31].

In this paper, personality type prediction from the text by utilizing the
“Myers-Briggs Type Indicator” on the “MBTI” dataset to predict candidates’
personality types [12]. The proposed method employs machine learning to create
a classifier that utilizes text as input to predict the author’s “MBTI”
personality type. The remainder of this paper is structured as follows:
Section 2 discusses related works; Section 3 outlines the research
methodology; Section 4 presents results and discussion; and Section 5
concludes the work.

##  II related works

###  II-A “Machine Learning”

“Machine learning” is used to train machines on effective handling of data.
Sometimes it is difficult for human to interpret a pattern or extract
information from vast amount of data. Machine learning is utilized in this
case [13]. Generally, machine learning is grouped into three types. For
instance, “supervised learning”, “unsupervised learning”, and “reinforcement
learning” [32,33]. “Supervised learning” and “Unsupervised learning” are the
most widely utilized and widely accepted methods [32]. The supervised machine
learning algorithms are those that require assistance from a human. The
training and testing datasets are separate, without overlap between them. An
output variable must be predicted or classified in the training dataset. It is
expected that an algorithm would learn patterns from training data and then
apply them to test data to predict or classify. “K-Nearest Neighbor (KNN)”,
“Logistic Regression”, and “Stochastic Gradient Descent” are examples of
classification algorithms.

Furthermore, unsupervised learning algorithms only extract a few features from
the data. Then when unseen data is introduced, it utilizes previously learned
features to predict the class of the new data. “K-Means”, “Mean Shift”, and “K
models” are just a few examples [14]. Meanwhile, “reinforcement learning” is
employed when the task at hand entails making a series of decisions that lead
to a final reward. An artificial agent is rewarded or punished for the actions
it takes during the training process. The goal of the learning process is to
maximize total reward. “Q-Learning” and the “Markov Decision Process” are two
examples of reinforcement learning algorithms.

###  II-B “Personality Prediction System from Facebook Users” [10]

“Facebook” has utilized Personality Prediction Systems for many years to
predict a user’s personality based on their “Facebook” functionalities
[10,30,31]. For users’ personalities, ”Facebook” utilized the “Big Five
Personality Traits model” [31]. This model would be utilized to discover
“Conscientiousness”, “Extraversion”, “Agreeableness”, “Openness”, and
“Neuroticism” [10]. The researchers utilized two dataset collections in this
study to predict the personalities of the users [30]. The first dataset is
made up of data samples from the “myPersonality” project, while the second was
built by hand [30]. Before proceeding to the next stage, English-language
texts are adjusted in the preprocessing stage. The removal of URLs, symbols,
names, and spaces, as well as the lowering of the case, stemming, and removal
of stop words, are all part of the preprocessing steps. Slang and non-standard
words in Bahasa Melayu data are replaced manually in a separate preprocessing
phase before those of the texts are translated to English.

In this study, traditional machine learning algorithms and deep learning were
utilized to run a series of tests to predict candidates’ personality types for
specifying job positions with maximum accuracy in the classification process.
Traditional machine learning algorithms include “Support Vector Machines”,
“Gradient Boosting”, “Naive Bayes”, “Linear Discriminant Analysis (LDA)”, and
“Logistic Regression” [30]. Deep learning implementations, on the other hand,
typically employ four architectures: “Multi-Layer Perceptrons (MLP)”, “Long
Short-Term Memory (LSTM)”, and “1-Dimensional Convolutional Neural Networks
(1D CNN)” [30].

Experimental algorithms of “deep learning” indicated that the “MLP
architecture” had the highest average accuracy in the “myPersonality” dataset
[10,30], while the “1D CNN+LSTM” architectures had the highest accuracy in the
gathered dataset [10,30]. To summarize, “deep learning” algorithms can be
utilized to improve dataset accuracy, even for low-accuracy traits.

###  II-C “Myers–Briggs Type Indicator (MBTI)”

Research in the personality field has long piqued the interest of
psychologists, and one such study was conducted on the “Myers–Briggs Type
Indicator” by a psychiatrist named “Carl Jung”. Then, “Katharine Briggs” and
“Isabel Myers Briggs” created the “Myers-Briggs Type Indicator” for testing
personality in the 1920s, based on “Jung’s theory of psychological types”
[5,8,30]. This model instrument has 16 personality types represented by a
“personality types key” as shown in Fig. 1 [7]. In the “MBTI” system, for
example, people classified as “INTPs” prefer “Introversion (I)”, “Intuition
(N)”, “Thinking (T)”, and “Perception (P)” personality traits. We can classify
the needs or behaviors of individuals according to labels, and then the
machine can learn the patterns.

As shown in Fig. 2, the preferences in four dimensions are indicated by
combining the 16 personality types. Each dimension corresponds to two distinct
personalities. The four dimensions are “Introversion (I) – Extraversion (E)”,
“Intuition (N) – Sensation (S)”, “Feeling (F) – Thinking (T)”, and “Perception
(P) – Judgment (J)” [8].

Text or related data can be utilized to extract a variety of personality-
related features. We can determine a user’s “MBTI” type by analyzing their
posts on the social platform utilizing “Term Frequency-Inverse Document
Frequency (TF-IDF)” to detect and quantify a person’s most frequently utilized
words.

Figure 1: A chart with descriptions of each Myers–Briggs personality type [24]

Figure 2:  Key Personality Types [25]

###  II-D “Recurrent Neural Networks”

“Recurrent Neural Networks” are a subset of feed-forward neural networks that
can send information along with time steps. They are a diverse family of
models that can perform nearly arbitrary computations [19,20]. It has been
demonstrated that finite-sized “Recurrent Neural Networks” with sigmoidal
activation functions can simulate a universal Turing machine in a well-known
result [20]. In practice, the ability to model temporal dependencies makes
“Recurrent Neural Networks” particularly well suited to tasks where the input
and/or output consists of non-independent sequences of points [20,21].

Advantages

  * •

“Recurrent Neutral Networks” can store records in such a way that each pattern
is assumed to be dependent on previous ones.

  * •

“Recurrent Neural Networks” are also utilized in combination with
convolutional layers to broaden the effective pixel neighborhood [41][42].

Disadvantages

  * •

“Recurrent Neutral Networks” mostly have problems with exploding and vanishing
gradients.

  * •

It is hard to train “Recurrent Neutral Networks”.

  * •

If tanh or ReLU is utilized as an activation function, it cannot handle very
long sequences.

###  II-E “Support Vector Machine” Classifiers

The “Support Vector Machines” Classifier is a supervised machine learning
algorithm useful for “classification” and “regression tasks” [17,34,36].
However, it is mostly utilized in classification tasks [36]. Each data point
is represented in N-dimensional space by the “Support Vector Machines”
algorithm, and each feature is represented in a specific coordinate [36].
Then, it can classify the data by locating the hyperplane that best separates
the two classes [18,27,34].

Advantages

  * •

When there is a clear margin between classes, the “Support Vector Machines”
perform reasonably well [35,39].

  * •

In high-dimensional spaces, “Support Vector Machines” are more effective.

  * •

“Support Vector Machines” are effective when the number of dimensions exceeds
the number of samples [35,39].

  * •

“Support Vector Machines” utilize a small amount of memory.

Disadvantages

  * •

The “Support Vector Machines” algorithm usually perform poorly for large
datasets.

  * •

If the dataset contains noise, overlap classes, and “Support Vector Machines”
do not perform well [35].

  * •

The “Support Vector Machines” may perform poorly when the number of features
in each data point outstrips the sample size of the training data [35].

###  II-F “Naive Bayes” Classifiers

The Bayes theorem is the foundation of the supervised machine learning
algorithm on “Naive Bayes”. Each feature will contribute independently and
equally to the target class or label [15,32]. Furthermore, when the likelihood
of a sample belonging to a specific class is increased, Then they stop
interacting with one another [32]. The “Naive Bayes” classifier is easy to
implement, computationally fast, and effective on large, high-dimensional
datasets [16,26,32].

Advantages

  * •

“Naive Bayes” can be used to solve multi-class prediction problems quickly and
efficiently.

  * •

When the feature independence hypothesis is true, it can outperform other
models while requiring substantially less training data.

Disadvantages

  * •

“Naive Bayes” presupposes that all characteristics are independent, which is
seldom the case. This restricts the algorithm’s usability in real-world use
applications [40].

  * •

This approach encounters the “zero-frequency problem” in which it assigns zero
probability to a categorical variable whose category is in the test data set
[40]. Also, it was not included in the training dataset [40].

  * •

Because its predictions might be inaccurate in some instances, its probability
outputs should not be taken too seriously.

##  III Research Methodology

###  III-A “CRoss Industry Standard Process for Data Mining (CRISP-DM)”

A schematic of “CRoss Industry Standard Process for Data Mining (CRISP-DM)” is
shown in Fig. 3. It is a free model that has become the industry standard in
data mining methodology [38]. Because of its industry and tool independence,
“CRISP-DM” can give instructions for the structured execution of any project.
All scheduled tasks are often divided into six separate periods [11, 38].

Figure 3: “CRISP-DM” process framework diagram [23]

  * •

“Business Understanding”: Learn the domain, clarify the goal, and plan [22].

  * •

“Data Understanding”:  Understand the data in all aspects [22].

  * •

“Data Preparation”:  Preprocessing and feature engineering [22].

  * •

“Modeling”:  Build the model [22].

  * •

“Evaluation”:  Evaluate model performance [22].

  * •

“Deployment”:  Deploy the model to end users [22].

The cycle process serves as a good overall framework for an end-to-end data
science product [22]. However, when tied to a product cycle, particularly in
the case of a modeling product, things become more complicated; this is where
agile data science can come into play [22].

###  III-B “Agile Methodology” with “CRISP-DM”

The agile development process is a development cycle that has been reduced to
a bare minimum [22]. The key to agile data science is, to begin with, a
minimal viable model as a baseline, then refine the model through multiple
iterations. We may not build the perfect model during this process, but we
will deliver a model with business value. In each sprint of our project, we
utilize “Agile methodology” and “CRISP-DM” as shown in Fig. 4.

Figure 4: “CRISP-DM” process framework with Agile Development diagram

###  III-C Data Understanding

Dataset

The “MBTI” dataset is shown in Fig. 9, which is publicly available on “Kaggle”
[12] and contains 8675 rows of post data. Each row has two columns, which are
the personality type based on “MBTI” and personal social networking posts from
“personalitycafe.com”. Users first complete a questionnaire that determines
their “MBTI” type. Then, it allows them to publicly chat or forum with another
user. since each user has fifty posts available to them. There are 430,000
data points in total. The data in each row contains the following:

  * •

Type (This persons 4 letter MBTI code/type)

  * •

A section from each of their last 50 posts (each entry separated by “ $|$ $|$
$|$ ” (3 pipe characters)) [12].

Exploratory Data Analysis

The objective of the exploratory data analysis was to use various tables and
graphs to generate a visual representation of the data for further
investigation. As shown in Fig. 5, the proportionality of “MBTI” type is shown
for the general population. There is a significant imbalance in the
“Introversion (I) - Extroversion (E)” and “Intuition (N) - Sensing (S)” pairs.
On the other hand, “Perception (P) - Thinking (T)” and “Judgment (J)” pairs
are quite balanced.

Then, we categorized the personality type keys into four dimensions as shown
in Fig. 6. In the first category of “Extroversion (E) – Introversion (I)”, the
distribution of “Extroversion (E)” is significantly bigger than that of
“Introversion (I)”. In the second category, “Sensation (S) – Intuition (N)”,
“Sensation (S)” have a significantly higher dispersion than “Intuition (N)”.
In the third category, “Thinking (T) – Feeling (F)”, “Thinking (T)” has a
somewhat greater distribution than “Feeling (F)”. Lastly, in the fourth
category, “Judgment (J) – Perception (P)”, “Judgment (J)” is more prevalent
than “Perception (P)”.

Then, for the concepts that were used the most frequently by specific classes
of the personality dimensions, we constructed word clouds. They were created
by deleting postings that had the most extreme class probability prediction.
The size of each term in the word clouds is then proportional to its frequency
of appearance in the top posts. We feel that these word clouds reflect some of
the unique ways that different “MBTI” utilize language, as shown in Figs. 7
and 8.

Figure 5: Proportionality diagram of “MBTI” types

Figure 6: Proportionality diagram of each “MBTI” type key

Figure 7: Unique word cloud for overall “MBTI” types

Figure 8: Unique word cloud for individual “MBTI” types

Figure 9:  “MBTI” Personality Type Dataset [12]

###  III-D Data Preparation

Preprocessing

To better comprehend the datasets, we included four more columns that were
categorized based on respondents’ responses to the four dimensions of “MBTI”:
Introversion (I )- “Extraversion (E)”, “Intuition (N) - Sensation (S)”,
“Feeling (F) - Thinking (T)”, and “Perception (P) - Judgment (J)”. The purpose
of the procedure is to improve the accuracy of “Naive Bayes”, “Support Vector
Machines”, and “Recurrent Neutral Networks”. When we added four columns on the
four dimensions of “Recurrent Neutral Networks”, we utilized those variables
as one-hot encodings with “pd.get_dummies()”. values.

Selective Word and Character Removal

Since the post data comes from a chat/forum named “personalitycafe.com” where
people communicate solely through written text. We removed some data points
that contained links to websites because we wanted our model to be generalized
in the English language. Also, we utilized “Python’s NLTK (Natural Language
Toolkit)” to remove so-called “stop words” from the text. “NLTK (Natural
Language Toolkit)” is a Python package for natural language processing.

Lemmatization

We will look at how inflected forms of the root word are transformed into
dictionary forms. To lemmatize the text, we utilized
“nltk.stem.wordNetLemmatizer”. This allows us to take advantage of the fact
that inflections still have a single shared meaning.

Tokenization

Tokenization for “Naive Bayes” and Support Vector Machiness Classifier

We tokenized the words that had been transformed in the lemmatization process
by utilizing an “NLTK word tokenizer”. That is, the common word is divided
into small fractions of text. Then, we change the text to frequency by a “Bag
of the Word (BoW)” and “Term Frequency-Inverse Document Frequency (TF-IDF)” to
examine the relevance of key-words to documents in the corpus [28,37].

Tokenization for “Recurrent Neutral Networks”

We tokenized the words that had been transformed in the lemmatization process
by utilizing a “Keras word tokenizer”. That is, the common word will change to
be in position 1, position 2, and so on until 74,870 in total, respectively.
Any other words that have been removed will now be in the form of lists of
integers with a vocabulary of 1–74,870. Then, we change texts to sequences
with 72,000 number words and pad the sequence with a max length of 200.

Data Splitting

To assess the correctness of the “MBTI” personality model, the dataset was
separated into two parts: training and testing. Utilizing the “train-test
split” function in the “Scikit-learn” package, we segregated 75% of the data
for training and 25% for testing. The testing dataset is a collection of
previously unknown data that is solely utilized to evaluate the efficiency of
a specific desired classifier.

###  III-E Modeling

Figure 10: “Recurrent Neural Networks” Architecture

Figure 11: Bi-directional Long Short-Term Memory (BI-LSTM) Architecture [29]

Classification Tasks

We can divide the classification task from 16 classes into binary classes.
Each binary class represents a unique dimension of personality as theorized by
the “Myers-Briggs Type Indicator”.

In terms of the “Naive Bayes” and “Support Vector Machines”, we imported the
“Scikit-learn” library to generate those. Also, we utilized TensorFlow to
create “Recurrent Neural Networks”. Then, utilizing the “Scikit-learn“
library’s train-test split” function, the datasets were divided into “75%
training” and “25% testing sets” for making a prediction, and the “Myers-
Briggs Type Indicator” was trained individually. To begin with, we remove all
columns that are unrelated to our features.

Modelling on “Naive Bayes” and “Support Vector Machines” classifiers

We utilized “Scikit-learn” to construct the “Naive Bayes” classifier, which is
a “multinomial-NB probabilistic” learning method that is commonly utilized in
“Natural Language Processing (NLP)”. It computes the likelihood of each tag
for a given sample and outputs the tag with the highest likelihood.

Second, we utilized “Support Vector Machines” with regularization parameter
with cost with 1, kernel parameter is linear with degree 3, and we also
applied gamma with auto to avoid exact match as per the training data set,
which tends to cause over-fitting.

Modelling on “Recurrent Neural Networks”

As shown in Fig. 10, we utilize the embedding word to define the indexes into
dense vectors of fixed size with a total length of vocabulary of 256. We
decided to utilize “CONV1D” on “Recurrent Neural Networks” because “CONV1D”
moves along a single axis. It makes perfect sense to apply this type of
convolution layer to sequential data, such as text. Then, as shown in Fig. 11,
to improve the performance of the “Recurrent Neural Networks” model, we added
“Bi-directional Long Short-Term Memory (BI-LSTM)” with a size of 64, allowing
the “Recurrent Neural Networks” to store sequence information in both
directions, backward (future to past) and forward (past to future).

##  IV Results and Discussion

Table I shows that the “Recurrent Neural Networks” outperform other machine
learning models in terms of accuracy in all four personality types. The
accuracy of “Recurrent Neural Networks” is significantly higher than that of
“Naive Bayes” and “Support Vector Machines” for all categories. On the other
hand, the accuracy of “Naive Bayes” and “Support Vector Machines” for
“Perception (P)” and “Judgment (J)” is significantly lower than that of the
“Recurrent Neural Networks”. As a result, the “Recurrent Neural Networks”
outperform the other three machine learning models on this dataset.

In contrast with the overall accuracy in each model shown in Table II, there
appears to be a general weakness in our model’s ability to classify all four
“MBTI” dimensions accurately. However, the number that represents perfect
classification does not indicate the efficacy of our model’s predictions of
overall “MBTI” types.

Since the “Recurrent Neural Networks” outperform, the confusion matrix of the
“Recurrent Neural Networks” model is shown in Fig. 12. For each “MBTI” model,
the results are mostly positioned as “True Positive” which means they are
projected as positive and turn out to be true. which is a false positive,
implying that the prediction is positive but incorrect.

Figure 12: Confusion Matrix on each “MBTI” models with RNN

Figure 13: Classification Report on each “MBTI” models with RNN (1)

Figure 14: Classification Report on each “MBTI” models with RNN (2)

Lastly, the classification report of the “Recurrent Neural Networks” is shown
in Fig. 13 and Fig. 14. This shows that the F-score or F-measure, which is a
weighted average score of the true positive (recall) and precision, is around
76% when calculated as the mean of all models.

##  V Conclusion

In conclusion, this study was able to predict personality utilizing social
network data with a machine learning algorithm that we applied. Also, the
“Recurrent Neutral Networks” machine learning algorithm is the best model for
predicting personality based on “MBTI”. Companies would substantially benefit
from this since they would be able to study their candidates’ social network
profiles before choosing suitable employees.

Limitation

The “Myers-Briggs Type Indicator” from the text is only the first tier in
developing a personality type model. The only social network utilized for this
project was the Personality Cafe forum. Other social networks may provide
useful data, allowing the prediction model to be improved. When building teams
to produce new software, play sports, or fight crime, a technical position is
one of the most important factors to consider when joining a team [30]. In
addition, people’s soft skills, such as mindset and personality, as well as
their living environment must be considered.

Future work

We intend to utilize the Generative Pre-trained Transformer 3 (GPT-3) which is
an autoregressive language model that leverages deep learning to generate
human-like text [19].

## References

  * [1] Zhang, W. (2016). The Application of Machine Learning Algorithms in Data Mining. DEStech Transactions on Engineering and Technology Research, iect. https://doi.org/10.12783/dtetr/iect2016/3817.
  * [2] Ahmed, F., Campbell, P., Jaffar, A., Alkobaisi, S., & Campbell, J. (2010). Learning & Personality Types: A Case Study of a Software Design Course. Journal of Information Technology Education: Innovations in Practice, 9, 237–252. https://doi.org/10.28945/1329.
  * [3] de Raad, B., & Mlačić, B. (2015). Big Five Factor Model, Theory and Structure. International Encyclopedia of the Social & Behavioral Sciences, 559–566. https://doi.org/10.1016/b978-0-08-097086-8.25066-6.
  * [4] Niemiec, R. M. (2012). VIA Character Strengths: Research and Practice (The First 10 Years). Cross-Cultural Advancements in Positive Psychology, 11–29. https://doi.org/10.1007/978-94-007-4611-4_2.
  * [5] Varvel, T., & Adams, S. (2003). A Study Of The Effect Of The Myers Briggs Type Indicator. 2003 Annual Conference Proceedings. Published. https://doi.org/10.18260/1-2–11800.
  * [6] Boyle, G. J. (1995). Myers-Briggs Type Indicator (MBTI): Some Psychometric Limitations. Australian Psychologist, 30(1), 71–74. https://doi.org/10.1111/j.1742-9544.1995.tb01750.x.
  * [7] Poursafar, Z., Devi, N.R., & Rodrigues, L.L. (2015). EVALUATION OF MYERS-BRIGGS PERSONALITY TRAITS IN OFFICES AND ITS EFFECTS ON PRODUCTIVITY OF EMPLOYEES: AN EMPIRICAL STUDY. International journal of current research and review, 7, 53-58. http://ijcrr.com/uploads/411_pdf.pdf.
  * [8] Mallari, S.D., & Pelayo, J.M. (2017). Myers-Briggs Type Indicator (MBTI) Personality Profiling and General Weighted Average (GWA) of Nursing Students. https://files.eric.ed.gov/fulltext/ED579286.pdf.
  * [9] Nguyen, D., Doğruöz, A. S., Rosé, C. P., & de Jong, F. (2016). Computational Sociolinguistics: A Survey. Computational Linguistics, 42(3), 537–593. https://doi.org/10.1162/coli_a_00258.
  * [10] Tandera, T., Hendro, Suhartono, D., Wongso, R., & Prasetio, Y. L. (2017). Personality Prediction System from Facebook Users. Procedia Computer Science, 116, 604–611. https://doi.org/10.1016/j.procs.2017.10.016.
  * [11] Shearer, C. (2000). The CRISP-DM model: the new blueprint for data mining. Journal of data warehousing, 5, 13–22. https://mineracaodedados.files.wordpress.com/2012/04/the-crisp-dm-model-the-new-blueprint-for-data-mining-shearer-colin.pdf.
  * [12] (MBTI) Myers-Briggs Personality Type Dataset. (2017, September 22). Kaggle. https://www.kaggle.com/datasnaek/mbti-type.
  * [13] A, D. (2016). Machine Learning Algorithms : A Review. International Journal of Computer Science and Information Technologies. Published. http://ijcsit.com/docs/Volume%207/vol7issue3/ijcsit2016070332.pdf.
  * [14] Sah, S. (2020). Machine Learning: A Review of Learning Types. Machine Learning: A Review of Learning Types. Published. https://doi.org/10.20944/preprints202007.0230.v1.
  * [15] Misra, S., & Li, H. (2020). Noninvasive fracture characterization based on the classification of sonic wave travel times. Machine Learning for Subsurface Characterization, 243–287. https://doi.org/10.1016/b978-0-12-817736-5.00009-0.
  * [16] SHORT SURVEY ON NAIVE BAYES ALGORITHM. (2017). International Journal of Advance Engineering and Research Development, 4(11). https://doi.org/10.21090/ijaerd.40826.
  * [17] Kecman, V. (2005). Basics of Machine Learning by Support Vector Machines. Real World Applications of Computational Intelligence, 49–103. https://doi.org/10.1007/11364160_2.
  * [18] Tomar, D., & Agarwal, S. (2013). A survey on Data Mining approaches for Healthcare. International Journal of Bio-Science and Bio-Technology, 5(5), 241–266. https://doi.org/10.14257/ijbsbt.2013.5.5.25.
  * [19] Siegelmann, H. T., & Sontag, E. D. (1991). Turing computability with neural nets. Applied Mathematics Letters, 4(6), 77–80. https://doi.org/10.1016/0893-9659(91)90080-f.
  * [20] Lipton, Z. C. (2015, May 29). A Critical Review of Recurrent Neural Networks for Sequence Learning. ArXiv.Org. https://arxiv.org/abs/1506.00019.
  * [21] Sharkawy, A. N. (2020). Principle of Neural Networks and Its Main Types: Review. Journal of Advances in Applied & Computational Mathematics, 7(1), 8–19. https://doi.org/10.15377/2409-5761.2020.07.2.
  * [22] Wu, T. S. D. (2020, February 26). What’s The Right Agile Data Science Process For Your Organization? A42 Labs. https://www.a42labs.io/agile-data-science-1.
  * [23] Jensen, K. (2012, April 12). IBM SPSS Modeler CRISP-DM Guide. International Business Machines Corporation (IBM). http://public.dhe.ibm.com/software/analytics/spss/documentation/modeler /18.0/en/ModelerCRISPDM.pdf.
  * [24] Beech, J. (2014, January 28). A chart with descriptions of each Myers–Briggs personality type and the four dichotomies central to the theory [Chart]. https://commons.wikimedia.org/w/index.php?title=File: MyersBriggsTypes.png&oldid=538599539.
  * [25] Tieger, P. D., Barron, B., & Tieger, K. (2021). Do What You Are: Discover the Perfect Career for You Through the Secrets of Personality Type (Revised ed.). Little, Brown Spark.
  * [26] Zainab Mahmood Fadhil. (2021). Hybrid of K-means clustering and naive Bayes classifier for predicting performance of an employee. Periodicals of Engineering and Natural Sciences, 9. http://dx.doi.org/10.21533/pen.v9i2.1898.
  * [27] Pereira, S., & Joshi, U. (2014). Implementation of Support Vector Machines Technique in Feedback Analysis System. International Journal of Computer Applications, 96(17), 24–28. https://doi.org/10.5120/16887-6906.
  * [28] Qaiser, S., & Ali, R. (2018). Text Mining: Use of TF-IDF to Examine the Relevance of Words to Documents. International Journal of Computer Applications, 181(1), 25–29. https://doi.org/10.5120/ijca2018917395.
  * [29] Cui, Z., Ke, R., Pu, Z., & Wang, Y. (2020). Stacked bidirectional and unidirectional LSTM recurrent neural networks for forecasting networks-wide traffic state with missing values. Transportation Research Part C: Emerging Technologies, 118, 102674. https://doi.org/10.1016/j.trc.2020.102674.
  * [30] Abidin, N. H. Z., Akmal, M., Mohd, N., Nincarean, D., Yusoff, N., Karimah, H., & H, A. (2020). Improving Intelligent Personality Prediction using Myers-Briggs Type Indicator and Random Forest Classifier. International Journal of Advanced Computer Science and Applications, 11(11). https://doi.org/10.14569/ijacsa.2020.0111125.
  * [31] Amirhosseini, M. H., & Kazemian, H. (2020). Machine Learning Approach to Personality Type Prediction Based on the Myers–Briggs Type Indicator. Multimodal Technologies and Interaction, 4(1), 9. https://doi.org/10.3390/mti4010009.
  * [32] Misra, S., Li, H., & He, J. (2019). Machine Learning for Subsurface Characterization (1st ed.). Gulf Professional Publishing.
  * [33] So, A., Joseph, T., V., John, R. T., Worsley, A., & Asare, S. (2020). The Data Science Workshop: Learn how you can build machine learning models and create your own real-world data science projects, 2nd Edition (2nd ed.). Packt Publishing.
  * [34] Smys, S., Bestak, R., Palanisamy, R., & Kotuliak, I. (2021). Computer Networks and Inventive Communication Technologies: Proceedings of Fourth ICCNCT 2021 (Lecture Notes on Data Engineering and Communications Technologies Book 75). Springer.
  * [35] Dhar, V., Beg, M., Saxena, A., & Sharma, S. (2021). Capillary Suction Timer and machine learning techniques as tools for evaluating the performance of different shale inhibitors used in drilling mud. Journal of Natural Gas Science and Engineering, 96, 104301. https://doi.org/10.1016/j.jngse.2021.104301.
  * [36] Sohana, J. F., Rupa, R. J., & Rahman, M. (2021). Bengali Stop Word Detection Using Different Machine Learning Algorithms. Algorithms for Intelligent Systems, 131–142. https://doi.org/10.1007/978-981-16-0586-4_11.
  * [37] Qaiser, S., & Ali, R. (2018). Text Mining: Use of TF-IDF to Examine the Relevance of Words to Documents. International Journal of Computer Applications, 181(1), 25–29. https://doi.org/10.5120/ijca2018917395.
  * [38] Castelo-Branco, F., Reis, J. L., Vieira, J. C., & Cayolla, R. (2019). Business Intelligence and Data Mining to Support Sales in Retail. Marketing and Smart Technologies, 406–419. https://doi.org/10.1007/978-981-15-1564-4_38.
  * [39] K, D. (2020, December 26). Top 4 advantages and disadvantages of Support Vector Machine or SVM. Medium. https://dhirajkumarblog.medium.com/top-4-advantages-and-disadvantages-of-support-vector-machine-or-svm-a3c06a2b107.
  * [40] Sweta Bhise , Shrutika Gadekar , Aishwarya Singh Gaur , Simran Bepari, Deepmala Kale, Dr. Shailendra Aswale, 2021, Breast Cancer Detection using Machine Learning Techniques, INTERNATIONAL JOURNAL OF ENGINEERING RESEARCH & TECHNOLOGY (IJERT) Volume 10, Issue 07 (July 2021).
  * [41] Reddy P, B. S. (2020, May 26). A Chatbot in Python using nltk - The Startup. Medium. https://medium.com/swlh/a-chatbot-in-python-using-nltk-938a37a9eacc.
  * [42] Gudikandula, P. (2021, March 14). Recurrent Neural Networks and LSTM explained - purnasai gudikandula. Medium. https://purnasaigudikandula.medium.com/recurrent-neural-networks-and-lstm-explained-7f51c7f6bbb9.


# Echocardiography video synthesis from end diastolic semantic map via
diffusion model

###### Abstract

Denoising Diffusion Probabilistic Models (DDPMs) have demonstrated significant
achievements in various image and video generation tasks, including the domain
of medical imaging. However, generating echocardiography videos based on
semantic anatomical information remains an unexplored area of research. This
is mostly due to the constraints imposed by the currently available datasets,
which lack sufficient scale and comprehensive frame-wise annotations for every
cardiac cycle. This paper aims to tackle the aforementioned challenges by
expanding upon existing video diffusion models for the purpose of cardiac
video synthesis. More specifically, our focus lies in generating video using
semantic maps of the initial frame during the cardiac cycle, commonly referred
to as end diastole. To further improve the synthesis process, we integrate
spatial adaptive normalization into multiscale feature maps. This enables the
inclusion of semantic guidance during synthesis, resulting in enhanced realism
and coherence of the resultant video sequences. Experiments are conducted on
the CAMUS dataset, which is a highly used dataset in the field of
echocardiography. Our model exhibits better performance compared to the
standard diffusion technique in terms of multiple metrics, including FID, FVD,
and SSMI.

Index Terms—  Diffusion Model, Echocardiography, Semantic Generation, Video
Synthesis

Fig. 1: Conditional Diffusion Model for Semantic Echocardiography Video
Synthesis. Our framework transforms a tensor of standard Gaussian noise into a
realistic echocardiography video via iterative denoising process, given the
guidance of the semantic label map $x$

##  1 Introduction

Echocardiography is an ultrasound of the heart that supports cardiologists in
assessing the structure and function of the heart. It is widely used in
diagnosis thanks to its accessibility, affordability, and non-invasiveness. In
recent years, many research efforts have been made to apply machine learning
to echocardiography to improve image analysis, automate diagnostic tasks, and
advance our understanding of cardiac conditions [1, 2]. However, one of the
biggest challenges in echocardiography today is the degradation of image
quality caused by the ultrasound image formation process. Ultrasound images
frequently contain speckle noise and motion artifacts, which can result in
inaccurate anatomical structure examination and expensive manual annotation of
echocardiograms. [3]. The traditional method of developing machine learning
involves collecting and manually labeling a large number of data samples.
Manual annotations must be done by clinical specialists, which is costly and
time-consuming. Synthesizing ultrasound images has recently come to light as a
promising method for obtaining a wide range of reliable datasets for training
machine learning models [4].

Two primary approaches are frequently utilized for synthesizing ultrasound
images: physics-based simulation and machine learning-based image generation.
The goal of physics-based simulation is to reproduce the processes of
beamforming and ultrasound formation, seeking to mimic their behavior and
characteristics [5, 6]. However, to accurately simulate the underlying
physics, these methods require realistic scatter maps of the heart. Moreover,
obtaining these realistic scatter maps at a large scale is extremely
difficult.

On the other hand, conditional ultrasound image generation has demonstrated
promising outcomes [4, 7, 8]. Previously, Generative Adversarial Networks
(GANs) have been the go-to solution to generate ultrasound sequences [9].
Multiple approaches were also put forth to control the model’s generating
behavior. Liang _et al._ [10] proposed a sketch guided GANs to obtain an
editable image synthesis model. Gilbert _et al._ [4] suggested using GANs
conditioned on semantic maps from 3D deformable cardiac models to generate
ultrasound images. Nevertheless, GANs still suffered from poor mode coverage
[11].

Recently, diffusion models [12] have emerged as powerful generative models and
demonstrated their effectiveness in generating realistic data. They could
produce ultrasound images and videos based on conditions such as clinical
attributes or segmentation maps. For example, Reynaud _et al._ [7] utilized
cascaded diffusion model conditioned on End Diastolic (ED) frame to generate
ultrasound image with various left ventricle ejection fractions (LVEFs)
levels. However, the model requires a real ultrasound image as an initial
condition, limiting the diversity of generated images. Stojanovski _et al._
[8] also used diffusion models but use semantic label maps as conditions. But
their model was designed to generate single image, and extending it to
generate image sequences is non-trivial due to the unavailability of fully
annotated ultrasound videos. A solution is to convert the 2D Convolutional
Neural Networks (CNNs) into 3D CNNs [13]. However, this approach is
computationally inefficient and requires a lot of memory. Pan _et al._ [14]
proposed a method that generates videos based on optical flow, but accurate
optical flow estimation is necessary for its success. As a result, little has
been done to synthesize echocardiography videos using single semantic label
map. This presents a unique challenge that needs to be addressed to be able to
generate coherent and accurate echocardiography sequences.

Contribution. In this paper, we present an echocardiography video generation
model based on DDPMs [12, 15]. By dynamically incorporating the semantic label
map of diastolic in multi-scale decoder, our model could produce realistic
echocardiography sequences with diverse anatomical structures. Our
contributions could be summarized as follows: (1) To the best of our
knowledge, this study is the first attempt at generating echocardiography
video from a semantic label map using diffusion model. (2) We propose a new
network structure to handle noisy input and semantic mask effectively in order
to incorporate anatomical information and produce realistic ultrasound
sequences.

##  2 Method

Fig. 2: Our proposed network architecture. The 3D Denoising UNet takes the
semantic segmentation map of the ED frame $x$ and the perturbed $y_{t}$ at
denoising step $t$. The model predict the noise $\epsilon_{\theta}$ for
reverse process to obtain synthesis sample $\hat{y}_{i}$ corresponding to $x$.

Our model generates a new video by gradually removing Gaussian noise under the
guidance from semantic segmentation map (see Figure 1). In the next section,
we will describe the conditional DDPMs and explain how we incorporate semantic
information into the denoising process.

Conditional DDPMs. There are two Markov process involved in DDPMS, i.e.
forward process and reverse process. The forward process progressively adds
noise into data, whereas the reverse process tries to eliminate it. Given the
condition $x$, the goal of conditional DDPMs is to maximize the likelihood
$p_{\theta}(y_{0}|x)$ while the conditional data follows to a distribution
$q(y_{0}|x)$. Starting from a Gaussian noise
$p(y_{T})\sim\mathcal{N}(0,\mathbf{I})$, the reverse process
$p_{\theta}(y_{0:T}|x)$ is a Markov process with learned Gaussian transitions,
which is formulated as follows:

$p_{\theta}(y_{0:T}|x)=p(y_{T})\prod_{t=1}^{T}p_{\theta}(y_{t-1}|y_{t},x)$ (1)
$p_{\theta}(y_{t-1}|y_{t},x)=\mathcal{N}(y_{t-1};\mu_{\theta}(y_{t},x,t),\Sigma_{\theta}(y_{t},x,t))$
(2)

The forward process takes a data sampled from a real data distribution
$q(y_{0})$ and iteratively perturbing the data by adding a small Gaussian
noise according to a variance schedule $\beta_{1},\dots\beta_{T}$. The
transition distribution is formulated as follows:

$q(y_{t}|y_{t-1})=\mathcal{N}(y_{t};\sqrt{1-\beta_{t}}y_{t-1},\beta_{t}\mathbf{I})$
(3)

Let $\alpha_{t}=\prod_{s=1}^{t}(1-\beta_{t})$, we could compute the transition
distribution of $y_{t}$ given $y_{0}$ directly with formula:

$q(y_{t}|y_{0})=\mathcal{N}(y_{t};\sqrt{\alpha_{t}}y_{0},(1-\alpha_{t})\mathbf{I})$
(4)

The conditional DDPMs is trained by maximizing the Evidence Lower Bound. By
applying reparameterization trick, this is equivalent to minimizing the
discrepancy between the noise added in the forward process and the noise
removed during the reverse process. Therefore, the objective function at time
step $t$ is defined as follow:

$\mathcal{L}_{t}=\mathbb{E}_{y_{0}\sim
q(y_{0}),\epsilon\sim\mathcal{N}(0,\mathbf{I})}{\parallel\epsilon-\epsilon_{\theta}(y_{t},x,t)\parallel}^{2}$
(5)

where $t$ is sampled uniformly from the range $[1\dots T]$ and $y_{0}$ is
sampled from real data distribution $q(y_{0})$. In the context of our study,
$y_{0}$ is a sequence of frames captured within a cardiac cycle
$y_{0}\in\mathbb{R}^{K\times C\times H\times W}$. Where $K$ represents the
fixed number of selected frames in one video and $C,H,W$ is the spatial
dimensions of each frame. Moreover, each cycle was given an annotated semantic
map of the first frame $x\in\mathbb{R}^{C\times H\times W}$, which will serve
as the condition for our model. This semantic map has same spatial dimension
as the original images. Thus, our goal is to learn a model that could generate
realistic data from given semantic structure.

Semantic Conditioned Diffusion Model. Figure 2 shows an overview of our
conditional denoising network architecture, which is based on 3D-Unet proposed
by Ho _et al._ [15]. The denoising encoder receives the noisy image sequence
and computes the feature representations. The decoder then uses these feature
vectors and the injected semantic information to reconstruct the real images.

Since our input is a sequence of frames, we used a stack of multiple 3D
Residual Convolution Blocks as our encoder. For each block, 3D Convolution
layers were used to compute the feature representations. The time step
information $t$ was encoded by cosine embedding and then added to every
feature outputs. Group normalization is then used to normalize those features.
Further more, we used a spatial attention layer followed by a temporal
attention layer in each block to allow the model to learn the spatial and
temporal relationships between each frame.

In the decoder, each residual block was modified so that the condition
information, which is the semantic map describing the structure of the heart,
could be effectively injected. Saharia _et al._[16] showed that directly
concatenate the condition information and noisy images as input does not fully
leverage the semantic information. Whereas, Wang _et al._[17] demonstrated the
effective of Spatial Adaptive Normalization (SPADE) for adding the semantic
label map. The features were regulated by the SPADE in a learnable, spatially-
adaptive manner. Therefore, we inject the semantic label map using SPADE layer
over Group Normalization layer. Specifically, given a feature vector $f_{i}$
of input images from a decoder block, we want to add the condition information
$x$, which is the semantic label map of the first frame. Since $x$ does not
initially match the size of the input images, it must be duplicated along the
temporal axis. The normalization is formulated as follows:

$f^{i+1}=\gamma^{i}(x,k)\cdot\text{Norm}(f^{i})+\delta^{i}(x,k)$ (6)

where $f^{i}$ and $f^{i+1}$ are the input and output features of SPADE.
$\text{Norm}(\cdot)$ is parameter-free group normalization. The
$\gamma^{i}(x,k)$ and $\delta^{i}(x,k)$ are the spatially-adaptive weight and
bias learned from the semantic label map $x$ and cosine embedding $k$ of frame
time. Since we only inject the label map of the first frame, $k$ was added to
provide the temporal information.

Inspired by [18], we applied classifier free approach to train our model.
Since it is showed that the gradient $\nabla_{y}\text{log}p(x|y)$ of an extra
classifier could improve samples from conditional diffusion models [19]. The
key idea is to replace the semantic label map $x$ with a null label
$\emptyset$ under certain probability. [18] showed that this technique
implicitly infers the gradient of the log probability. The sampling procedure
is obtained as following formula:

$\epsilon_{\theta}(y_{t}|x)=\epsilon_{\theta}(y_{t}|x)+s\cdot(\epsilon_{\theta}(y_{t}|x)-\epsilon_{\theta}(y_{t}|\emptyset))$
(7)

In our implementation, $\emptyset$ is a black image with all-zero elements.

##  3 Experiments

Dataset. Our experiments were conducted on the CAMUS dataset [20]. There are
450 patients in this dataset, and each has three recorded chamber views. For
simplicity, we only conducted experiments on 2 chamber view videos in our
study. For each data sample, we have a video of a complete cardiac cycle, from
the ED phase to ES phase. However, only the ED and ES frames have semantic map
annotation, which were labeled by cardiologists. There are four classes on
each segmentation map: background, epicardium, myocardium, and left atrium. To
avoid data leakage, we split the dataset by patients using 80-10-10 ratio. As
a result, the training set contains 360 patients, the validation and test set
contains 45 patients, respectively.

Baselines. Since our model was based on DDPMs, we used this model as the
baseline. Besides, we also implemented the cascade diffusion architecture [21]
to validate the efficacy of this technique for semantic conditional
generation. Since this model have been shown to generate videos more
efficiently, including unconditioned ultrasound generation [7]. In addition to
these two primary architectures, we have implemented SPADE and concatenation
as two condition features injection approaches. We validated our models using
variety of number frames settings, including taking 16 or 24 frames.

Experimental Settings. Every models were trained on a node with three NVIDIA
A100 gpus. We set the batch size of 24 for three GPUs. We chose the total
diffusion steps $T=1000$, and the classifier-free guidance factor $s=7.0$ was
used. We used Adam optimizer with learning rate $lr=1e-4$ in every training.
Two UNet backbones were utilized for the cascade network architecture. One for
low-resolution video synthesis, i.e. generate sequences with dimension of
$n_{frame}\times 56\times 56$. The second one is for super-resolution which
converts output with spatial dimension of $56\times 56$ into $128\times 128$.
We kept all of the settings the same to ensure a fair comparision.

Evaluation Metrics. We assessed the models’ performances using three metrics.
Which are the Fréchet Inception Distance (FID) [22], Fréchet Video Distance
(FVD) [23], and Structure Similarity Index (SSIM) score [24]. FID and FVD have
been commonly used in many studies to measure generated images and videos
quality. FID computes the distance between two distributions, one from
generated images and the other from real images, whereas FVD does the same for
videos. A lower score indicates higher quality in terms of visual fidelity,
diversity, and temporal consistency of the generated videos. SSIM score is
used for measuring the similarity between two images. In our study, we
calculate this score by averaging SSIM between frames of generated videos with
frames from ground truth videos, while both have the same segmentation map.
Higher SSIM score indicates higher similarity between synthetic frames and the
ground-truth frames. We generated totally 450 videos for the test set, with 10
videos for each segmentation map.

Cond. | Model | $K$ | FID$\downarrow$ | FVD$\downarrow$ | SSIM$\uparrow$
---|---|---|---|---|---
Concat | Cascade | 16 | 42.93 | 278.35 | 0.47
24 | 50.93 | 310.05 | 0.51
DDPM | 16 | 28.56 | 137.73 | 0.55
24 | 21.46 | 144.79 | 0.53
SPADE(our) | Cascade | 16 | 34.52 | 214.45 | 0.49
24 | 40.87 | 231.88 | 0.52
DDPM | 16 | 18.65 | 89.78 | 0.56
24 | 16.05 | 115.79 | 0.54
Table 1: Quantitative comparison with existing methods on semantic
echocardiography video synthesis. $\uparrow$ indicates the higher the better,
while $\downarrow$ indicates the lower the better. Notably, our method
achieves state-of-the-art performance on all metrics.

Results. Table 1 presents the results of the methods on various metrics.
Overall, using SPADE as the input to the denoising model instead of
concatenating the segmentation map and ultrasound led to an improvement in the
quality of ultrasound images from both a single image and a video perspective.
For instance, in the case of DDPM, SPADE has FID of 16.05 as compared to
concatenation’s 21.46 and FVD of 115.79 as compared to concatenation’s 144.79.
When comparing cascade and DDPM, we noticed that DDPM produce better
performance, with FVD of 89.78 for DDPM versus 214.45 for cascade. One
explanation could be that the DDPM architecture uses convolution layers and
attention layers for the entire input resolution, but the cascade model only
performs temporal attention on downsampled versions of inputs. The cascade
approach, however, is more effective in terms of processing and memory.
Additionally, we found that the amount of frames had no noticeable effect on
the model’s performance. This could be as a result of the segmentation map
being the same for all video frames. Finally, SSIM score are generally better
when using SPADE than those using concatination.

Fig. 3: Qualitative results on the CAMUS dataset. All models were conditioned
on the same segmentation map of the ED frame. We selected frames every 4 time
steps to show the temporal change in one video. More videos can be found at
https://tinyurl.com/5n8m6k92.

A visual comparison of different approaches is shown in Figure 3. In general,
the images produced by our suggested method using SPADE have higher fidelity
and closely resemble actual ultrasound images. More specifically, our model
generates images with sharper edges and more realistic anatomical structures,
especially in the region of endocardium and myocardium. While the original
DDPMs with concatination produces images with blurry edges and artifacts,
SPADE could produce images with perceivable speckle motion. Comparing DDPM and
Cascade, we found that DDPM produces better images in terms of visual fidelity
and speckle motion over time. While our photos and the SPADE’s ground truth
have extremely similar anatomical structures, there are still some artifacts
and blurry speckles in them. We also recommended that human review should be
done to better understand the quality of the generated videos and that future
work should take into account training the models on longer, higher resolution
videos that show different moments in the cardiac cycle.

##  4 Conclusion

In our study, we demonstrate the first attempt to synthesize an
echocardiography video using a diffusion model from a single semantic
segmentation map. In order to effectively use the semantic information in the
generation process, we proposed spatial adaptive normalization to better
incorporate the semantic maps into the denoising model. This results in our
model producing more realistic echocardiography videos that are consistent
with the input segmentation maps in comparison with previous methods, as we
show on the CAMUS dataset. We also examine the shortcomings of recent work and
consider potential directions for future investigation.

## References

  * [1] J. Zhou, M. Du, S. Chang, and Z. Chen,  “Artificial intelligence in echocardiography: detection, functional evaluation, and disease diagnosis,”  Cardiovascular ultrasound, vol. 19, no. 1, pp. 1–11, 2021.
  * [2] A. Ghorbani, D. Ouyang, A. Abid, B. He, J. H. Chen, R. A. Harrington, D. H. Liang, E. A. Ashley, and J. Y. Zou,  “Deep learning interpretation of echocardiograms,”  NPJ digital medicine, vol. 3, no. 1, pp. 10, 2020.
  * [3] G. Varoquaux and V. Cheplygina,  “Machine learning for medical imaging: methodological failures and recommendations for the future,”  NPJ Digital Medicine, vol. 5, no. 1, pp. 48, 2022.
  * [4] A. Gilbert, M. Marciniak, C. Rodero, P. Lamata, E. Samset, and K. McLeod,  “Generating synthetic labeled data from existing anatomical models: An example with echocardiography segmentation,”  IEEE Trans Med Imaging, vol. 40, pp. 2783–2794, 10 2021.
  * [5] B. Burger, S. Bettinghausen, M. Radle, and J. Hesser,  “Real-Time GPU-Based Ultrasound Simulation Using Deformable Mesh Models,”  IEEE Trans Med Imaging, vol. 32, pp. 609–618, March 2013.
  * [6] D. Garcia,  “Simus: an open-source simulator for medical ultrasound imaging. part i: theory & examples,”  Computer Methods and Programs in Biomedicine, vol. 218, pp. 106726, 2022.
  * [7] H. Reynaud, M. Qiao, M. Dombrowski, T. Day, R. Razavi, A. Gomez, P. Leeson, and B. Kainz,  “Feature-conditioned cascaded video diffusion models for precise echocardiogram synthesis,” 2023.
  * [8] D. Stojanovski, U. Hermida, P. Lamata, A. Beqiri, and A. Gomez,  “Echo from noise: synthetic ultrasound image generation using diffusion models for real image segmentation,”  arXiv preprint arXiv:2305.05424, 2023.
  * [9] J. Liang, X. Yang, Y. Huang, K. Liu, X. Zhou, X. Hu, Z. Lin, H. Luo, Y. Zhang, Y. Xiong, et al.,  “Weakly-supervised high-fidelity ultrasound video synthesis with feature decoupling,”  in Proc. MICCAI, LNCS. Springer, 2022, pp. 310–319.
  * [10] J. Liang, X. Yang, Y. Huang, H. Li, S. He, and e. a. Hu, Xindi,  “Sketch guided and progressive growing GAN for realistic and editable ultrasound image synthesis,”  Medical Image Analysis, vol. 79, pp. 102461, July 2022.
  * [11] S. Zhao, H. Ren, A. Yuan, J. Song, N. Goodman, and S. Ermon,  “Bias and generalization in deep generative models: An empirical study,”  Proc. NeurIPS, vol. 31, 2018.
  * [12] J. Ho, A. Jain, and P. Abbeel,  “Denoising Diffusion Probabilistic Models,”  in Proc. NeurIPS, 2020, vol. 33, pp. 6840–6851.
  * [13] T.-C. Wang, M.-Y. Liu, J.-Y. Zhu, G. Liu, A. Tao, J. Kautz, and B. Catanzaro,  “Video-to-video synthesis,”  arXiv preprint arXiv:1808.06601, 2018.
  * [14] J. Pan, C. Wang, X. Jia, J. Shao, L. Sheng, J. Yan, and X. Wang,  “Video generation from single semantic label map,”  in Proc. CVPR, 2019, pp. 3733–3742.
  * [15] J. Ho, T. Salimans, A. Gritsenko, W. Chan, M. Norouzi, and D. J. Fleet,  “Video Diffusion Models,” June 2022,  arXiv:2204.03458.
  * [16] C. Saharia, W. Chan, H. Chang, C. A. Lee, J. Ho, T. Salimans, D. J. Fleet, and M. Norouzi,  “Palette: Image-to-image diffusion models,” 2022.
  * [17] W. Wang, J. Bao, W. Zhou, D. Chen, D. Chen, L. Yuan, and H. Li,  “Semantic image synthesis via diffusion models,” 2022.
  * [18] J. Ho and T. Salimans,  “Classifier-Free Diffusion Guidance,” July 2022,  arXiv:2207.12598.
  * [19] P. Dhariwal and A. Nichol,  “Diffusion models beat gans on image synthesis,” 2021.
  * [20] S. Leclerc, E. Smistad, J. Pedrosa, A. Østvik, F. Cervenansky, F. Espinosa, T. Espeland, E. A. R. Berg, P.-M. Jodoin, T. Grenier, et al.,  “Deep learning for segmentation using an open large-scale dataset in 2d echocardiography,”  IEEE Trans Med Imaging, vol. 38, no. 9, pp. 2198–2210, 2019.
  * [21] J. Ho, C. Saharia, W. Chan, D. J. Fleet, M. Norouzi, and T. Salimans,  “Cascaded Diffusion Models for High Fidelity Image Generation,”  Journal of Machine Learning Research, vol. 23, pp. 1–33, 2022.
  * [22] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter,  “Gans trained by a two time-scale update rule converge to a local nash equilibrium,”  Neurips, vol. 30, 2017.
  * [23] T. Unterthiner, S. Van Steenkiste, K. Kurach, R. Marinier, M. Michalski, and S. Gelly,  “Towards accurate generative models of video: A new metric & challenges,”  arXiv preprint arXiv:1812.01717, 2018.
  * [24] Z. Wang, A. Bovik, H. Sheikh, and E. Simoncelli,  “Image quality assessment: from error visibility to structural similarity,”  IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600–612, 2004.


# Inequalities for Euler-Mascheroni constant

Hongmin Xu and Xu You

(Jun 26, 2014)

###### Abstract

The aim of this paper is to establish new inequalities for the Euler-
Mascheroni by the continued fraction method.

0002010 Mathematics Subject Classification: 11Y60, 41A25, 41A20000Key words
and phrases: Euler-Mascheroni constant, rate of convergence, continued
fraction, Taylor’s formula, harmonic sequence

##  1 Introduction

Euler’s Constant was first introduced by Leonhard Euler (1707-1783) in 1734 as
the limit of the sequence

(1.1) $\displaystyle\gamma(n):=\sum_{m=1}^{n}\frac{1}{m}-\ln n.$

It is also known as the Euler-Mascheroni constant. There are many famous
unsolved problems about the nature of this constant(See e.g. the survey papers
or books of R.P. Brent and P. Zimmermann[1], Dence and Dence[3], Havil[5] and
Lagarias[8]). For example, it is a long-standing open problem if it is a
rational number. A good part of its mystery comes from the fact that the known
algorithms converging to $\gamma$ are not very fast, at least, when they are
compared to similar algorithms for $\pi$ and $e$.

The sequence $\left(r(n)\right)_{n\in\mathbb{N}}$ converges very slowly toward
$\gamma$, like $(2n)^{-1}$. Up to now, many authors are preoccupied to improve
its rate of convergence, see e.g. [2, 3, 4, 6, 7, 9, 10, 11, 14] and
references therein. We list some main results as follows:

$\displaystyle\sum_{m=1}^{n}\frac{1}{m}-\ln\left(n+\frac{1}{2}\right)=\gamma+O(n^{-2}),\quad\mbox{(DeTemple,
\cite[cite]{[\@@bibref{}{De}{}{}]})}$

$\displaystyle\sum_{m=1}^{n}\frac{1}{m}-\ln\frac{n^{3}+\frac{3}{2}n^{2}+\frac{227}{240}+\frac{107}{480}}{n^{2}+n+\frac{97}{240}}=\gamma+O(n^{-6}),\quad\mbox{(Mortici,
\cite[cite]{[\@@bibref{}{Mor1}{}{}]})}$

$\displaystyle\sum_{m=1}^{n}\frac{1}{m}-\ln\left(1+\frac{1}{2n}+\frac{1}{24n^{2}}-\frac{1}{48n^{3}}+\frac{23}{5760n^{4}}\right)=\gamma+O(n^{-5}),\quad\mbox{(Chen
and Mortici, \cite[cite]{[\@@bibref{}{CM}{}{}]})}$

Recently, Mortici and Chen[14] provided a very interesting sequence

$\displaystyle\nu(n)=$
$\displaystyle\sum_{m=1}^{n}\frac{1}{m}-\frac{1}{2}\ln\left(n^{2}+n+\frac{1}{3}\right)$
$\displaystyle-\left(\frac{-\frac{1}{180}}{\left(n^{2}+n+\frac{1}{3}\right)^{2}}+\frac{\frac{8}{2835}}{\left(n^{2}+n+\frac{1}{3}\right)^{3}}++\frac{\frac{5}{1512}}{\left(n^{2}+n+\frac{1}{3}\right)^{4}}+\frac{\frac{592}{93555}}{\left(n^{2}+n+\frac{1}{3}\right)^{5}}\right),$

and proved

(1.2)
$\displaystyle\lim_{n\rightarrow\infty}n^{12}\left(\nu(n)-\gamma\right)=-\frac{796801}{43783740}.$

Hence the rate of the convergence of the sequence
$\left(\nu(n)\right)_{n\in\mathbb{N}}$ is $n^{-12}$.

Very recently, by inserting the continued fraction term in (1.1), Lu[9]
introduced a class of sequences $\left(r_{k}(n)\right)_{n\in\mathbb{N}}$(see
Theorem 1 below), and showed

(1.3) $\displaystyle\frac{1}{72(n+1)^{3}}<\gamma-r_{2}(n)<\frac{1}{72n^{3}},$
(1.4)
$\displaystyle\frac{1}{120(n+1)^{4}}<r_{3}(n)-\gamma<\frac{1}{120(n-1)^{4}}.$

In fact, Lu[9] also found $a_{4}$ without proof. In general, the continued
fraction method could provide a better approximation than others, and has less
numerical computations.

First, we will prove

######  Theorem 1.

For Euler-Mascheroni constant, we have the following convergent sequence

$\displaystyle r(n)=1+\frac{1}{2}+\cdots+\frac{1}{n}-\ln
n-\frac{a_{1}}{n+\frac{a_{2}n}{n+\frac{a_{3}n}{n+\ddots}}},$

where
$(a_{1},a_{2},a_{4},a_{6},a_{8},a_{10},a_{12})=\left(\frac{1}{2},\frac{1}{6},\frac{3}{5},\frac{79}{126},\frac{7230}{6241},\frac{4146631}{3833346},\frac{306232774533}{179081182865}\right)$,
and $a_{2k+1}=-a_{2k}$ for $1\leq k\leq 6$.

Let

$\displaystyle
R_{k}(n):=\frac{a_{1}}{n+\frac{a_{2}n}{n+\frac{a_{3}n}{n+\frac{a_{4}n}{\frac{\ddots}{n+a_{k}}}}}},$

(See Appendix for their simple expressions) and

$\displaystyle r_{k}(n):=\sum_{m=1}^{n}\frac{1}{m}-\ln n-R_{k}(n).$

For $1\leq k\leq 13$, we have

(1.5)
$\displaystyle\lim_{n\rightarrow\infty}n^{k+1}\left(r_{k}(n)-\gamma\right)=C_{k},$

where
$(C_{1},\cdots,C_{13})=\left(-\frac{1}{12},-\frac{1}{72},\frac{1}{120},\frac{1}{200},-\frac{79}{25200},-\frac{6241}{3175200},\frac{241}{105840},\frac{58081}{22018248},-\frac{262445}{91974960},\right.$

$\left.-\frac{2755095121}{892586949408},\frac{20169451}{3821257440},\frac{406806753641401}{45071152103463200},-\frac{71521421431}{5152068292800}\right)$.

Open problem For every $k\geq 1$, we have $a_{2k+1}=-a_{2k}$ .

The main aim of this paper is to improve (1.3) and (1.4). We establish the
following more precise inequalities.

######  Theorem 2.

Let $r_{10}(n),r_{11}(n)$, $C_{10}$ and $C_{11}$ be defined in Theorem 1, then

(1.6) $\displaystyle C_{10}\frac{1}{(n+1)^{11}}<\gamma-
r_{10}(n)<C_{10}\frac{1}{n^{11}},$ (1.7) $\displaystyle
C_{11}\frac{1}{(n+1)^{12}}<r_{11}(n)-\gamma<C_{11}\frac{1}{n^{12}}.$

######  Remark 1.

In fact, Theorem 2 implies that $r_{10}(n)$ is a strictly increasing function
of $n$, whereas $r_{11}(n)$ is a strictly decreasing function of $n$.
Certainly, it has the similar inequalities for $r_{k}(n)(1\leq k\leq 9)$, we
leave these for readers to verify. It is also should be noted that (1.4)
cannot deduce the monotony of $r_{3}(n)$.

######  Remark 2.

It is worth to pointing out that Theorem 2 provides sharp bounds for harmonic
sequence, which are superior to Theorem 3 and 4 of Mortici and Chen[14].

##  2 The Proof of Theorem 1

The following lemma gives a method for measuring the rate of convergence, This
Lemma was first used by Mortici[12, 13] for constructing asymptotic
expansions, or to accelerate some convergences. For proof and other details,
see, e.g., [13].

######  Lemma 1.

If the sequence $(x_{n})_{n\in\mathbb{N}}$ is convergent to zero and there
exists the limit

(2.1)
$\displaystyle\lim_{n\rightarrow+\infty}n^{s}(x_{n}-x_{n+1})=l\in[-\infty,+\infty]$

with $s>1$, then there exists the limit:

(2.2) $\displaystyle\lim_{n\rightarrow+\infty}n^{s-1}x_{n}=\frac{l}{s-1}.$

In the sequel, we always assume $n\geq 2$.

We need to find the value $a_{1}\in\mathbb{R}$ which produces the most
accurate approximation of the form

(2.3) $\displaystyle r_{1}(n)=\sum_{m=1}^{n}\frac{1}{m}-\ln
n-\frac{a_{1}}{n},$

here we note $R_{1}(n)=\frac{a_{1}}{n}$. To measure the accuracy of this
approximation, we usually say that an approximation (2.3) is better as
$r_{1}(n)-\gamma$ faster converges to zero. Clearly

(2.4) $\displaystyle
r_{1}(n)-r_{1}(n+1)=\ln\left(1+\frac{1}{n}\right)-\frac{1}{n+1}+\frac{a_{1}}{n+1}-\frac{a_{1}}{n}.$

It is well-known that for $|x|<1$,

$\displaystyle\ln(1+x)=\sum_{m=1}^{\infty}(-1)^{m-1}\frac{x^{m}}{m}\quad\mbox{and}\quad\frac{1}{1-x}=\sum_{m=0}^{\infty}x^{m}.$

Developing the expression (2.4) into power series expansion in $\frac{1}{n}$,
we easily obtain

(2.5) $\displaystyle
r_{1}(n)-r_{1}(n+1)=\left(\frac{1}{2}-a_{1}\right)\frac{1}{n^{2}}+\left(a_{1}-\frac{2}{3}\right)\frac{1}{n^{3}}+\left(\frac{3}{4}-a_{1}\right)\frac{1}{n^{4}}+O\left(\frac{1}{n^{5}}\right).$

From Lemma 1, we see that the rate of convergence of the sequence
$\left(r_{1}(n)-\gamma\right)_{n\in\mathbb{N}}$ is even higher as the value
$s$ satisfying (2.1). By lemma 1, we have

(i) If $a_{1}\neq\frac{1}{2}$, then the rate of convergence of the
$\left(r_{1}(n)-\gamma\right)_{n\in\mathbb{N}}$ is $n^{-1}$, since

$\displaystyle\lim_{n\rightarrow\infty}n\left(r_{1}(n)-\gamma\right)=\frac{1}{2}-a_{1}\neq
0.$

(ii) If $a_{1}=\frac{1}{2}$, from (2.5) we have

$\displaystyle
r_{1}(n)-r_{1}(n+1)=-\frac{1}{6}\frac{1}{n^{3}}+O\left(\frac{1}{n^{4}}\right).$

Hence the rate of convergence of the
$\left(r_{1}(n)-\gamma\right)_{n\in\mathbb{N}}$ is $n^{-2}$, since

$\displaystyle\lim_{n\rightarrow\infty}n^{2}\left(r_{1}(n)-\gamma\right)=-\frac{1}{12}.$

We also observe that the fastest possible sequence
$\left(r_{1}(n)\right)_{n\in\mathbb{N}}$ is obtained only for
$a_{1}=\frac{1}{2}$.

Just as Lu[9] did, we may repeat the above approach to determine $a_{1}$ to
$a_{4}$ step by step. However, the computations become very difficult when
$k\geq 5$. In this paper we will use the _Mathematica_ software to manipulate
symbolic computations.

Let

(2.6) $\displaystyle r_{k}(n)=\sum_{m=1}^{n}\frac{1}{m}-\ln n-R_{k}(n),$

then

(2.7) $\displaystyle
r_{k}(n)-r_{k}(n+1)=\ln\left(1+\frac{1}{n}\right)-\frac{1}{n+1}+R_{k}(n+1)-R_{k}(n).$

It is easy to get the following power series

(2.8)
$\displaystyle\ln\left(1+\frac{1}{n}\right)-\frac{1}{n+1}=\sum_{m=2}^{\infty}(-1)^{m}\frac{m-1}{m}\frac{1}{n^{m}}.$

Hence the key step is to expand $R_{k}(n+1)-R_{k}(n)$ into power series in
$\frac{1}{n}$. Here we use some examples to explain our method.

Step 1: . For example, given $a_{1}$ to $a_{7}$, find $a_{8}$. Define

(2.9) $\displaystyle R_{8}(n)=$
$\displaystyle\frac{\frac{1}{2}}{n+\frac{\frac{n}{6}}{n+\frac{-\frac{n}{6}}{n+\frac{\frac{3}{5}*n}{n+\frac{\frac{-3}{5}*n}{n+\frac{\frac{79}{126}*n}{n+\frac{\frac{-79}{126}*n}{n+a_{8}}}}}}}}$
$\displaystyle=$
$\displaystyle\frac{-237+1405a_{8}+1800n+1740a_{8}n-630n^{2}+3780a_{8}n^{2}+3780n^{3}}{6(79a_{8}+600a_{8}n+600n^{2}+790a_{8}n^{2}+1260a_{8}n^{3}+1260n^{4})}.$

By using the _Mathematica_ software(The _Mathematica Program_ is very similar
to one given in Remark 3 below, however it has a parameter $a_{8}$), we obtain

(2.10) $\displaystyle R_{8}(n+1)-R_{8}(n)$ $\displaystyle=$
$\displaystyle-\frac{1}{2n^{2}}+\frac{2}{3n^{3}}-\frac{3}{4n^{4}}+\frac{4}{5n^{5}}-\frac{5}{6n^{6}}+\frac{6}{7n^{7}}-\frac{7}{8n^{8}}$
$\displaystyle+\frac{360030-6241a_{8}}{396900n^{9}}+\frac{-346440+24964a_{8}+6241a_{8}^{2}}{352800n^{10}}+O\left(\frac{1}{n^{11}}\right).$

Substituting (2.8) and (2.10) into (2.7), we get

(2.11) $\displaystyle r_{8}(n)-r_{8}(n+1)=$
$\displaystyle\left(-\frac{8}{9}+\frac{360030-6241a_{8}}{396900}\right)\frac{1}{n^{9}}$
$\displaystyle+\left(\frac{9}{10}+\frac{-346440+24964a_{8}+6241a_{8}^{2}}{352800}\right)\frac{1}{n^{10}}+O\left(\frac{1}{n^{11}}\right).$

The fastest possible sequence $\left(r_{8}(n)\right)_{n\in\mathbb{N}}$ is
obtained only for $a_{8}=\frac{7230}{6241}$. At the same time, it follows from
(2.11),

(2.12) $\displaystyle
r_{8}(n)-r_{8}(n+1)=\frac{58081}{2446472}\frac{1}{n^{10}}+O\left(\frac{1}{n^{11}}\right),$

the rate of convergence of the $\left(r_{8}(n)-\gamma\right)_{n\in\mathbb{N}}$
is $n^{-9}$, since

$\displaystyle\lim_{n\rightarrow\infty}n^{9}\left(r_{8}(n)-\gamma\right)=-\frac{58081}{22018248}.$

We can use the above approach to find $a_{k}(3\leq k\leq 8)$. Unfortunately,
it does not work well for $a_{9}$. Since $a_{3}=-a_{2}$, $a_{5}=-a_{4}$ and
$a_{7}=-a_{6}$. So we may conjecture $a_{9}=-a_{8}$. Now let’s check it
carefully.

Step 2:  Check $a_{9}=-\frac{7230}{6241}$ to
$a_{13}=-\frac{306232774533}{179081182865}$.

Let $a_{1},\cdots,a_{9}$, and $R_{9}(n)$ be defined in Theorem 1. Applying the
_Mathematica_ software, we obtain

(2.13) $\displaystyle R_{9}(n+1)-R_{9}(n)$ $\displaystyle=$
$\displaystyle-\frac{1}{2n^{2}}+\frac{2}{3n^{3}}-\frac{3}{4n^{4}}+\frac{4}{5n^{5}}-\frac{5}{6n^{6}}+\frac{6}{7n^{7}}-\frac{7}{8n^{8}}+\frac{8}{9}\frac{1}{n^{9}}$
$\displaystyle-\frac{9}{10}\frac{1}{n^{10}}+\frac{736265}{836136}\frac{1}{n^{11}}+O\left(\frac{1}{n^{12}}\right),$

which is the desired result. Substituting (2.8) and (2.13) into (2.7), we get

(2.14) $\displaystyle
r_{9}(n)-r_{9}(n+1)=-\frac{262445}{9197496}\frac{1}{n^{11}}+O\left(\frac{1}{n^{12}}\right),$

the rate of convergence of the $\left(r_{9}(n)-\gamma\right)_{n\in\mathbb{N}}$
is $n^{-10}$, since

$\displaystyle\lim_{n\rightarrow\infty}n^{10}\left(r_{9}(n)-\gamma\right)=-\frac{262445}{91974960}.$

Next, we can use the Step 1 to find $a_{10}$, and the Step 2 to check $a_{11}$
and $a_{12}$. It should be noted that Theorem 2 will provide their another
proofs for $a_{10}$ and $a_{11}$. So we omit the details here.

Finally, we check $a_{13}=-\frac{306232774533}{179081182865}$.

(2.15) $\displaystyle R_{13}(n+1)-R_{13}(n)$ $\displaystyle=$
$\displaystyle-\frac{1}{2n^{2}}+\frac{2}{3n^{3}}-\frac{3}{4n^{4}}+\frac{4}{5n^{5}}-\frac{5}{6n^{6}}+\frac{6}{7n^{7}}-\frac{7}{8n^{8}}+\frac{8}{9}\frac{1}{n^{9}}$
$\displaystyle-\frac{9}{10}\frac{1}{n^{10}}+\frac{10}{11}\frac{1}{n^{11}}-\frac{11}{12}\frac{1}{n^{12}}+\frac{12}{13}\frac{1}{n^{13}}-\frac{13}{14}\frac{1}{n^{14}}$
$\displaystyle+\frac{1903648586623}{2576034146400}\frac{1}{n^{15}}+O\left(\frac{1}{n^{16}}\right).$

Substituting (2.8) and (2.15) into (2.7), one has

(2.16) $\displaystyle
r_{13}(n)-r_{13}(n+1)=-\frac{500649950017}{2576034146400}\frac{1}{n^{15}}+O\left(\frac{1}{n^{16}}\right).$

Since

$\displaystyle\lim_{n\rightarrow\infty}n^{14}\left(r_{13}(n)-\gamma\right)=-\frac{71521421431}{5152068292800},$

thus the rate of convergence of the
$\left(r_{13}(n)-\gamma\right)_{n\in\mathbb{N}}$ is $n^{-14}$.

This completes the proof of Theorem 1.∎

######  Remark 3.

In fact, if the assertion $a_{13}=-\frac{306232774533}{179081182865}$ holds,
then the other values $a_{j}(1\leq j\leq 12)$ must be true. The following
_Mathematica program_ will generate $R_{13}(n+1)-R_{13}(n)$ into power series
in $\frac{1}{n}$ with order 16:

Normal[Series$[(R_{13}[n+1]-R_{13}[n])/.\quad n\rightarrow
1/x,\\{x,0,16\\}]]/.\quad x\rightarrow 1/n$

######  Remark 4.

It is a very interesting question to find $a_{k}$ for $k\geq 14$. However, it
seems impossible by the above method.

##  3 The Proof of Theorem 2

Before we prove the Theorem 2, let us give a simple inequality, which plays an
important role of the proof.

######  Lemma 2.

Let $f^{\prime\prime}(x)$ be a continuous function. If
$f^{\prime\prime}(x)>0$, then

(3.1) $\displaystyle\int_{a}^{a+1}f(x)dx>f(a+1/2).$

###### Proof.

Let $x_{0}=a+1/2$. By Taylor’s formula, we have

$\displaystyle\int_{a}^{a+1}f(x)dx=$
$\displaystyle\int_{a}^{a+1}\left(f(x_{0})+f^{\prime}(x_{0})(x-x_{0})+\frac{1}{2}f^{\prime\prime}(\theta_{x})(x-x_{0})^{2}\right)dx$
$\displaystyle>$
$\displaystyle\int_{a}^{a+1}\left(f(x_{0})+f^{\prime}(x_{0})(x-x_{0})\right)dx$
$\displaystyle=$ $\displaystyle f(a+1/2).$

This completes the proof of Lemma 2.∎

In the sequel, the notation $P_{k}(x)$ means a polynomial of degree $k$ in $x$
with all of its non-zero coefficients positive, which may be different at each
occurrence.

Let’s begin to prove Theorem 2. Note $r_{10}(\infty)=0$, it is easy to see

(3.2) $\displaystyle\gamma-
r_{10}(n)=\sum_{m=n}^{\infty}\left(r_{10}(m+1)-r_{10}(m)\right)=\sum_{m=n}^{\infty}f(m),$

where

$f(m)=\frac{1}{m+1}-\ln\left(1+\frac{1}{m}\right)-R_{10}(m+1)+R_{10}(m).$

Let $D_{1}=\frac{2755095121}{6762022344}$. By using the _Mathematica_
software, we have

$\displaystyle
f^{\prime}(x)+D_{1}\frac{1}{(x+1)^{13}}=-\frac{P_{19}(x)(x-1)+1619906998377\cdots
5270931}{33810111720x(1+x)^{13}P_{10}^{(1)}(x)P_{10}^{(2)}(x)}<0,$

and

$\displaystyle
f^{\prime}(x)+D_{1}\frac{1}{\left(x+\frac{1}{2}\right)^{13}}=\frac{P_{22}(x)}{4226263965x(1+x)^{2}(1+2x)^{13}P_{10}^{(3)}(x)P_{10}^{(4)}(x)}>0.$

Hence, we get the following inequalities for $x\geq 1$,

(3.3) $\displaystyle
D_{1}\frac{1}{(x+1)^{13}}<-f^{\prime}(x)<D_{1}\frac{1}{(x+\frac{1}{2})^{13}}$

Applying $f(\infty)=0$, (3.3) and Lemma 2, we get

(3.4) $\displaystyle f(m)=$
$\displaystyle-\int_{m}^{\infty}f^{\prime}(x)dx\leq
D_{1}\int_{m}^{\infty}\left(x+\frac{1}{2}\right)^{-13}dx$ $\displaystyle=$
$\displaystyle\frac{D_{1}}{12}\left(m+\frac{1}{2}\right)^{-12}\leq\frac{D_{1}}{12}\int_{m}^{m+1}x^{-12}dx.$

From (3.1) and (3.4) we obtain

(3.5) $\displaystyle\gamma-r_{10}(n)\leq$
$\displaystyle\sum_{m=n}^{\infty}\frac{D_{1}}{12}\int_{m}^{m+1}x^{-12}dx$
$\displaystyle=$
$\displaystyle\frac{D_{1}}{12}\int_{n}^{\infty}x^{-12}dx=\frac{D_{1}}{132}\frac{1}{n^{11}}.$

Similarly, we also have

$\displaystyle f(m)=$ $\displaystyle-\int_{m}^{\infty}f^{\prime}(x)dx\geq
D_{1}\int_{m}^{\infty}\left(x+1\right)^{-13}dx$ $\displaystyle=$
$\displaystyle\frac{D_{1}}{12}(m+1)^{-12}\geq\frac{D_{1}}{12}\int_{m+1}^{m+2}x^{-12}dx,$

and

(3.6) $\displaystyle\gamma-r_{10}(n)\geq$
$\displaystyle\sum_{m=n}^{\infty}\frac{D_{1}}{12}\int_{m+1}^{m+2}x^{-12}dx$
$\displaystyle=$
$\displaystyle\frac{D_{1}}{12}\int_{n+1}^{\infty}x^{-12}dx=\frac{D_{1}}{132}\frac{1}{(n+1)^{11}}.$

Combining (3.5) and (3.6) completes the proof of (1.6).

Note $r_{11}(\infty)=0$, it is easy to deduce

(3.7) $\displaystyle
r_{11}(n)-\gamma=\sum_{m=n}^{\infty}\left(r_{11}(m)-r_{11}(m+1)\right)=\sum_{m=n}^{\infty}g(m),$

where

$g(m)=\ln\left(1+\frac{1}{m}\right)-\frac{1}{m+1}-R_{11}(m)+R_{11}(m+1).$

We write $D_{2}=\frac{20169451}{24495240}$. By using the _Mathematica_
software, we have

$\displaystyle-g^{\prime}(x)-D_{2}\frac{1}{(x+1)^{14}}=\frac{P_{18}(x)}{24495240x^{3}(1+x)^{14}P_{8}^{(1)}(x)P_{8}^{(2)}(x)}>0$

and

$\displaystyle-g^{\prime}(x)-D_{2}\frac{1}{\left(x+\frac{1}{2}\right)^{14}}=-\frac{P_{19}(x)(x-1)+4622005677839353997724676307741}{6123810x^{3}(1+x)^{3}(1+2x)^{14}P_{8}^{(3)}(x)P_{8}^{(4)}(x)}<0.$

Hence for $x\geq 1$,

(3.8) $\displaystyle
D_{2}\frac{1}{(x+1)^{14}}<-g^{\prime}(x)<D_{2}\frac{1}{\left(x+\frac{1}{2}\right)^{14}}.$

Applying $g(\infty)=0$, (3.8) and (3.1), we get

(3.9) $\displaystyle g(m)=$
$\displaystyle-\int_{m}^{\infty}g^{\prime}(x)dx\leq
D_{2}\int_{m}^{\infty}\left(x+\frac{1}{2}\right)^{-14}dx$ $\displaystyle=$
$\displaystyle\frac{D_{2}}{13}\left(m+\frac{1}{2}\right)^{-13}\leq\frac{D_{2}}{13}\int_{m}^{m+1}x^{-13}dx.$

It follows from (3.7) and (3.9)

(3.10) $\displaystyle r_{11}(n)-\gamma\leq$
$\displaystyle\sum_{m=n}^{\infty}\frac{D_{2}}{13}\int_{m}^{m+1}x^{-13}dx$
$\displaystyle=$
$\displaystyle\frac{D_{2}}{13}\int_{n}^{\infty}x^{-13}dx=\frac{D_{2}}{156}\frac{1}{n^{12}}.$

Finally,

$\displaystyle g(m)=$ $\displaystyle-\int_{m}^{\infty}g^{\prime}(x)dx\geq
D_{2}\int_{m}^{\infty}(x+1)^{-14}dx$ $\displaystyle=$
$\displaystyle\frac{D_{2}}{13}(m+1)^{-13}\geq\frac{D_{2}}{13}\int_{m+1}^{m+2}x^{-13}dx.$

and

(3.11) $\displaystyle r_{11}(n)-\gamma\geq$
$\displaystyle\sum_{m=n}^{\infty}\frac{D_{2}}{13}\int_{m+1}^{m+2}x^{-13}dx$
$\displaystyle=$
$\displaystyle\frac{D_{2}}{13}\int_{n+1}^{\infty}x^{-13}dx=\frac{D_{2}}{156}\frac{1}{(n+1)^{12}}.$

Combining (3.10) and (3.11) completes the proof of (1.7).∎

######  Remark 5.

As an example, we give the _Mathematica Program_ for the proof of the left-
hand side of (3.3):

(i) Together[D[$f[x],\\{x,1\\}$]$+D_{1}(x+1)^{13}$];

(ii) Take out the numerator $P[x]$ of the above rational function, then
manipulate the program: Apart[$P[x]/(x-1)$].

##  4 Competing Interests

The authors declare that they have no competing interests.

##  5 Authors’ Contributions

Hongmin Xu conceived of the algorithm and helped to draft the manuscript. Xu
You carried out the design of the program and drafted the manuscript. All
authors read and approved the final manuscript.

##  6 Acknowledgements

The authors thank Prof. Xiaodong Cao for his help.

This research of this paper was supported by the National Natural Science
Foundation of China (Grant No.11171344) and the Natural Science Foundation of
Beijing (Grant No.1112010).

Appendix For the reader’s convenience, we rewrite $R_{k}(n)$ ($k\leq 13$) with
minimal denominators as following.

$\displaystyle R_{1}(n)=$ $\displaystyle\frac{1}{2n},$ $\displaystyle
R_{3}(n)=$ $\displaystyle\frac{1}{2n}-\frac{1}{12}\frac{1}{n^{2}},$
$\displaystyle R_{5}(n)=$ $\displaystyle\frac{1}{2n}-\frac{5}{6(1+10n^{2})},$
$\displaystyle R_{7}(n)=$
$\displaystyle\frac{1}{2n}-\frac{79}{1200}\frac{1}{n^{2}}-\frac{147}{400(10+21n^{2})},$
$\displaystyle R_{9}(n)=$
$\displaystyle\frac{1}{2n}-\frac{7(871+790n^{2})}{20(241+3990n^{2}+3318n^{4})},$
$\displaystyle R_{11}(n)=$
$\displaystyle\frac{1}{2n}-\frac{52489}{894348}\frac{1}{n^{2}}-\frac{1237227621+584280400n^{2}}{4471740(3549+13020n^{2}+5302n^{4})},$
$\displaystyle R_{13}(n)=$
$\displaystyle\frac{1}{2n}-\frac{39577260671+66288226620n^{2}+15762446700n^{4}}{1260(20169451+434410620n^{2}+646328298n^{4}+150118540n^{6})}.$

$\displaystyle R_{2}(n)=$ $\displaystyle\frac{3}{6n+1},$ $\displaystyle
R_{4}(n)=$ $\displaystyle\frac{13+30n}{6(1+6n+10n^{2})},$ $\displaystyle
R_{6}(n)=$
$\displaystyle\frac{5(281+348n+756n^{2})}{6(79+600n+790n^{2}+1260n^{3})},$
$\displaystyle R_{8}(n)=$
$\displaystyle\frac{964337+2646000n+2599730n^{2}+2621220n^{3}}{20(19039+144600n+315210n^{2}+303660n^{3}+262122n^{4})},$
$\displaystyle R_{10}(n)=$
$\displaystyle\frac{7(108237701+208886046n+523341290n^{2}+210464400n^{3}+230000760n^{4})}{20(12649849+107768934n+209431110n^{2}+395365320n^{3}+174158502n^{4}+161000532n^{5})},$
$\displaystyle R_{12}(n)=$
$\displaystyle(3604759235968501+11032319618513046n+17366281558290420n^{2}+19958033982902400n^{3}$
$\displaystyle+7661417445218460n^{4}+4964130389017800n^{5})/(1260(1058674313539+9019254081474n$
$\displaystyle+22801779033180n^{2}+33088387754520n^{3}+33925126033722n^{4}+13474242079452n^{5}$
$\displaystyle+7879572046060n^{6})).$

## References

  * [1] Richard P. Brent and Paul Zimmermann, Modern computer arithmetic. Cambridge Monographs on Applied and Computational Mathematics, 18. Cambridge University Press, Cambridge, 2011. xvi+221 pp.
  * [2] C.P. Chen, C. Mortici, New sequence converging towards the Euler-Mascheroni constant, Comput. Math. Appl. 64 (2012) 391–398.
  * [3] T.P. Dence, J.B. Dence, A survey of Euler s constant, Math. Mag. 82 (2009) 255–265.
  * [4] D.W. DeTemple, A quicker convergence to Euler’s constant, Amer. Math. Month. 100 (5) (1993) 468–470.
  * [5] J. Havil, Gamma: Exploring Euler s Constant, Princeton University Press, Princeton, NJ, 2003.
  * [6] I. Gavrea and M. Ivan, Optimal rate of convergence for sequences of a prescribed form. J. Math. Anal. Appl. 402 (2013), no. 1, 35–43.
  * [7] X. Gourdon and P. Sebah, Collection of formulae for the Euler constant. http://numbers.computation.free.fr/Constants/Gamma/gammaFormulas.pdf, or see http://numbers.computation.free.fr/Constants/constants.html
  * [8] Jeffrey C. Lagarias, Euler’s constant: Euler’s work and modern developments. Bull. Amer. Math. Soc. (N.S.) 50 (2013), no. 4, 527–628.
  * [9] Dawei Lu, A new quiker sequence convergent to Euler’s constant, J. Number Theory, 136(2014), 320–329.
  * [10] Dawei Lu, Some quicker classes of sequences convergent to Euler s constant, Appl. Math. and Comput. 232 (2014) 172–177.
  * [11] C. Mortici, On new sequences converging towards the Euler-Mascheroni constant, Comput. Math. Appl. 59 (8) (2010) 2610–2614.
  * [12] C. Mortici, Product approximations via asymptotic integration, Amer. Math. Month. 117 (5) (2010) 434–441.
  * [13] C. Mortici, New approximations of the gamma function in terms of the digamma function, Appl. Math. Lett. 23 (2010) 97–100.
  * [14] C. Mortici and C.P. Chen, On the harmonic number expansion by Ramanujan. J. Inequal. Appl. 2013, 2013:222, 10 pp.

Hongmin Xu

Department of Mathematics and Physics,

Beijing Institute of Petro-Chemical Technology,

Beijing 102617, P. R. China

e-mail<EMAIL_ADDRESS>

Xu You

1\. School of Mathematics and System Science,

Beijing University of Aeronautics and Astronautics,

Beijing 100191, P. R. China

2\. Department of Mathematics and Physics,

Beijing Institute of Petro-Chemical Technology,

Beijing 102617, P. R. China

e-mail<EMAIL_ADDRESS>