ESGI'120 Final Report: Key Problems
ESGI'120 Final Report: Key Problems
Study Group
with Industry
(ESGI’120)
July 25-29, 2016
Sofia, Bulgaria
PROBLEMS
&
FINAL REPORTS
FASTUMPRINT
2016
Organizers:
Faculty of Mathematics and Informatics
Sofia University “St. Kl. Ohridski”
Institute of Information and Communication Technologies, BAS
Institute of Mathematics and Informatics, BAS
in cooperation with
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
List of participants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Problems
Final reports
4
Preface
The 120th European Study Group with Industry (ESGI’120) was held in Sofia,
Bulgaria, July 25–29, 2016. It was organized by the Faculty of Mathematics
and Informatics, Sofia University “St. Kliment Ohridski” (FMI–SU), the In-
stitute of Information and Communication Technologies, Bulgarian Academy of
Sciences (IICT–BAS) and the Institute of Mathematics and Informatics, BAS
(IMI–BAS) in cooperation with the European Consortium for Mathematics in
Industry (ECMI). ESGI’120 was the fourth Study Group in Bulgaria, after the
very successful ESGI’113, September 14–18, 2015; ESGI’104, September 23–27,
2014; ESGI’95, September 23–27, 2013.
ESGI’120 was financially supported by the Mathematics for Industry Network
(MI-NET), COST Action funded project (TD 1409), which aims to facilitate
more effective widespread application of mathematics to all industrial sectors,
by encouraging greater interaction between mathematicians and industrialists.
We are grateful to the Core Group of MI-NET, and especially to the Chair Dr.
Joanna Jordan and the Project Manager Dr. Filipa Vance, for their assistance
and support. The event was also sponsored by the companies that posed problems
for solving.
ESGI’120 was hosted by the Faculty of Mathematics and Informatics, SU.
FMI provided excellent conditions for work and communication. Well-equipped
computer laboratories as well as the rich library of FMI were available for the
work of the participants. We thank Assoc. Prof. Dr. Nadya Zlateva, Vice-Dean
of FMI and member of the Scientific Advisory Committee, for her constant help
and support.
Study Groups with Industry are an internationally recognized method of tech-
nology transfer between academia and industry. These one-week long workshops
provide an opportunity for engineers and industrial developers to work together
with academic mathematicians, students and young professional mathematicians
on problems of direct practical interest.
The Organizing Committee selected seven problems to work on:
Six of the companies are Bulgarian. The company Gruner AG has had a
collaboration with the Institute of Mechanics, BAS.
The participants from Bulgaria (35) and from abroad (2), among which 1
BSc, 1 MSc, and 10 PhD students, were divided into seven groups, each group
working as a team on one of the problems. The Bulgarian participants were
from various Academic institutions: FMI–SU; IMI–BAS; IICT–BAS; Plovdiv
University; Veliko Tarnovo University; University of Blagoevgrad; University of
Rousse. The foreign participants were from the University of Genoa, Italy and
from the Herriot-Watt University, UK. Prof. Wil Schilders, a former President
of ECMI, attended the event for three days. We thank him for the permanent
interest and attention to the Bulgarian Study Groups, as well as for the valuable
discussions with the participants on most of the problems.
The traditional ECMI Modelling Week, organized this year by FMI as ECMI
Educational Center, was designed to run back-to-back (17–24.07) with ESGI’120.
On the last day of the workshop, the working groups presented the progress
in solving the problems and the recommended approaches for their further treat-
ment (including generalization, improvements and implementations). The pre-
sentations have been a basis of the final reports, which are assembled in this
booklet. The Study Group Final Report provides a formal record of the work for
both the industrial and the academic participants.
The description of the problems, the last day presentations and the final re-
ports of each working group, as well as a color copy of this booklet, are posted
on the website of ESGI’120:
[Link]
As usual the participants were awarded certificates for their valuable contri-
bution to the event.
6
List of participants
8
PROBLEMS
Problem 1. Multi-frame Denoising of Still
Images
MM Solutions AD
Angel Ivanov, aivanov@[Link]
Next image presents the image with least blur in the same sequence.
Noise characteristics
STD = 6.5 (from 8bit pixel values)
STD changes at different brightness about 2 times. The presented value is the
maximum STD, observed at pixel values about 64..128
12
ESGI’120 Multi-frame Denoising of Still Images
The noise is Gaussian, but not white – Low frequencies amplitudes are higher.
The next figure show a noise spectrum, measured on a flat (without details)
noisy part of one of the images in the same sequence. This is a “pink noise”,
typical for electronic circuits like the analog amplifiers embedded in the image
sensor.
More noise or less brightness can be expected at lower light, so there is no
upper bound of the noise STD – the more noise the algorithm can handle, the
better.
For sure, the noise in each individual image is more than the edges we would
like to enhance and see in the output image.
noise spectrum
Blur characteristics
Blur kernel changes smoothly within the image – it is not same for the whole
image, as opposed to the common assumption in most de-blur articles. This is
caused by 2 facts:
– camera shake is mainly rotational;
– contemporary image sensors use rolling shutter, i.e. different rows of the
image are exposed in different moments, for same amount of time. Hence, the
camera motion during exposures of the rows varies.
In typical hand-held capture case, the blur is up to about 20pix at 4000 × 3000
image resolution, at 1/15 sec exposure time, close to line.
Alignment
Appart from blur, hand shake causes the images not to be aligned to each
other. ALingment is NOT part of that project. We have an algorithm, which
aligns the images with up to 2pix error at 4000 × 3000 image resolution.
13
Multi-frame Denoising of Still Images ESGI’120
Preprocessing
The images are already pre-processed – color conversion and gamma correction
is applied, so they are not in linear space (lightness-vs-pixel value is not linear).
Finding the gamma applied is possible, but hard, so better to avoid it. The
processing parameters are same for all the images in the sequence, including
exposure time and gain.
Applying different exposure time and gain to the images is possible, but it
would lead to different lightness-vs-pixel response of each image and differences
in color. Thus, worse alignment and even worse moving-objects detection.
Moving-objects detection and handling is not part of this project, but yet, it
happens somewhere, so we have to keep in mind its presence. Basically, it leaves
the moving objects only from one of the images. Another approach is to leave the
moving objects to create ghosts – if the exposure periods of the subsequent images
are contiguous, this would create a moving object motion blur, as if captured with
a very long exposure period, i.e. the image will look consistent.
Approaches
To decrease the blur, exposure time can be reduced, but this leads to darker
image, i.e. less SNR.
To decrease the noise, either the gain could be decreased (thus less brightness,
less overall SNR) or exposure could be increased while decreasing the gain (keep
brightness, but increase blur).
Average all images – decreases the noise up to sqrt(number-of-images). De-
creases the blur also since different images ate blurred in different directions. Yet,
the residual blur may be will be more than the one of the least blurred image.
Debluring – there are many algos, simultaneous deblurring of multiple frames
shows good results (in the articles), but is very computationally expensive. Yet,
some simple approach is computationally acceptable. Note, deblurring increases
the noise, especially the figh frequencies. Also, belurring is very prone to creating
“ringing” artifacts near strong edges and overexposed areas.
14
Problem 2. Optimal Cutting Problem
STOBET Ltd, [Link]
Engineering company “STOBET” Ltd makes projects for buildings and struc-
tures. Having many such projects, we want to improve the quality and the price
of the process of their realization. In our work we use software for design of steel
constructions. The software gives the drawings of the different needed profiles.
After making all the drawings, the task is to deploy optimally all profiles on a
steel sheet.
The contour of the plates can be square, rectangle, trapeze, any non crossing
closed polyline, consisting of line segments only. The dimensions of the plates
are given by the coordinates of the vertices of the polylines as follows:
Plate 1: (X1 , Y1 ; X2 , Y2 ; X3 , Y3 )
Plate 2: (X1 , Y1 ; X2 , Y2 ; X3 , Y3 ; X4 , Y4 ; X5 , Y5 )
..............................................
Plate N : (X1 , Y1 ; X2 , Y2 ; X3 , Y3 ; X4 , Y4 )
The numbers K1 , K2 , . . . , KN of the pieces of plates with given profile, which
must be situated on the steel sheet, are given.
In the process of optimization some plates can be rotated for best fit.
The aim is to locate maximum small plates in the given big steel sheet. A
distance for cutting must be left between the plates. This distance is about 5
mm.
Optimal Cutting Problem ESGI’120
Optimization - Example
16
Problem 3. Authenticity Management
Algorithm for Digital Images
Adastra Bulgaria, [Link]
– The algorithm must be able to detect if the image has been tampered with
– e.g. re-saving, cropping, resizing, editing small parts of the image in a
photo-editing software, copying and moving regions, etc.
18
Problem 4. Laboratory Calibration of a
MEMS Rate Gyro Sensor
BG Drilling Solutions Ltd
Shteryo Lyomov
Introduction
In oil, gas or geological exploration borehole drilling and logging work, acquir-
ing the direction, inclination and orientation of the drilling tool as well as the
borehole is provided by surveying tools. Data from surveying tools is gathered
in real-time and transmitted to surface or stored into internal tool’s memory.
This information is used to the decision-making control side to adjust the
action of drill bit accurately, which will efficiently improve the quality of drilling
engineering or other application.
For those applications, where high accuracy or stability is required, MEMS
sensors – accelerometer, magnetometer and gyroscope are used. To maximize
performance, the sensors used in these applications are generally calibrated and
externally temperature compensated.
Simple borehole surveying technology is shown in Figure 1. In the example
accelerometers and gyro sensors are employed for precise direction (azimuth) and
inclination (dip) measurement in order to determine borehole 3D coordinates.
Background
Calibration is essential for providing the maximum of sensor specification. It
includes calculation of couple parameters (constants) used to normalize measured
data and most often include bias (offset), sensitivity (scale factor) and misalign-
ment.
Here we will focus on gyroscopes calibration. 3D gyroscopes measure the
angular velocity in inertial space around three perpendicular sensitivity axes.
Thus it allows for the orientation of an object to be determined. In general,
the orientation of a rigid body is the position of its coordinate system observed
relative to a reference coordinate system with the same origin. The orientation
can be described by a rotation that would move the rigid body’s coordinate
system, which is initially aligned with the reference coordinate system, to its new
position. When working with gyroscope measurements, we consider the gyroscope
as the rigid body and the inertial space coordinate system as the reference system.
Laboratory Calibration of a MEMS Rate Gyro Sensor ESGI’120
The measured angular velocity determines the rotation required to move the
sensor to its new position.
In the real world a physical body (surveying tool with sensors) has its position
and orientation expressed by the column vector Q of the real physical quantity
values in the basic coordinate system of the tool expressed by:
qx
Q = qy . (1)
qz
Then the values detected (measured) by a 3D sensor along its three sensitivity
axes in a column vector can be expressed by:
qs,x
Qs = qs,y . (2)
qs,z
In the noiseless model, the accuracy of the measured values Eq. (2) with
MEMS gyroscope depends on 1) the zero level offset; 2) the sensitivity, and 3)
the alignment of the three sensitivity axes of the sensor. In order to calibrate
20
ESGI’120 Laboratory Calibration of a MEMS Rate Gyro Sensor
21
Problem 5. Future Cyber Attacks Modelling
& Forecasting
TechnoLogica Ltd, [Link]
Eng. Georgi Dukov, gdukov@[Link]
Company Profile
TechnoLogica Ltd. is a leading Bulgarian software company, which since 1990
has been developing a comprehensive range of information technology services in-
cluding implementation of information systems, software development, consulting
and specialized training. The company has offices in the Bulgarian cities of Sofia,
Plovdiv, Varna and Burgas, in Serbia and in the Republic of Macedonia. Its team
numbers more than 200 experts in various fields, including experts with the high-
est levels of certification: PMI Project Management Professional, Oracle Master,
etc. More information about us is available at: [Link]
Problem Description
Modern digital world is constantly presenting new challenges, resulting from
cyber-physical clashes. One of the greatest problems in the present context is
adequately to react towards new threats and expected attacks in the evolving
modern world. Both social and technological system components have to be
studied in this sense.
A useful approach in support of the problem general coping is fusing expert,
observation and reference data in weighted graph-based analytical models. Fur-
ther, these however have to be adequately assessed and studied from multiple
cyberattack dynamic perspective.
Five key steps towards solving the problems could be defined:
1. Selection of typical cyberattacks for further exploration in accordance with
future digital space threats evolution prognosis;
2. Models definition for the selected cyberattacks in a suitable future explo-
ration context;
3. Multicriteria selection for models overall holistic assessment;
4. Software working environments selection and models machine prototyping;
5. Numerical simulations of the developed models and results discussion.
Problem 6. Post-Processing for Beam
Elements: Calculating the Second Order
Work and Strain Energy
Gruner AD, [Link]
1. Company’s Overview
The Basel-based Gruner Group is an independent market leader in engineering
and planning consultancy services. Founded over 150 years ago, we now have
more than 20 companies at over 30 sites in Switzerland and all over the world.
Gruner is a byword for construction services that set benchmarks in terms of
quality. A broad set of competencies, a committed workforce, in-depth expertise
and many years of project experience enable us to provide support for complex
building projects throughout their entire life cycle. The interdisciplinary team-
work adopted by Group companies guarantees that customers receive individual
solutions for challenging construction projects.
Through our cooperation with both higher education institutions and public
and private research teams, our knowledge is in a constant state of development.
3. Task description
A well-known criterion for failure (bifurcation in the solution) for models using
elasto-plastic formulation is the Hill’s failure [1] criterion based on the second
order work. The second order work is defined at the material point by:
u = d2 W = dσ : dε,
N J
[u] = 2
= 3.
m m
Hill’s condition of stability (Hill 1957) is defined by:
d2 W > 0
A related measure is the strain energy, which is the integrated value of the
second order work over a volume V :
Z Z
U= udV = dσ : dεdV,
V V
[U ] = J = N · m.
Unfortunately, the software package Plaxis does not calculate the second order
work. Furthermore, it only provides a small set of output variables at the element
nodes. The objective is to calculate the second order work for this kind of beam
elements as a post-processing after finishing the FE-simulation based only on the
nodal variables provided in the programs output. The output provided at each
node:
24
ESGI’120 Post-Processing for Beam Elements
From NFEM Ch11 [3] we found a formula to calculate the strain energy W
for a Timoshenko beam element. Is it also valid for a beam based on Mindlin’s
theory of plates? If not, please provide the correct solution.
Z
1 1
Z
0 2 0 2
W = N · e + E · A0 · e dX + G · γ + G · A0 · γ dX
L0 2 L0 2
Z
0 1 2
+ M · κ + E · l0 · κ dX
L0 2
4. Expected Results
• Show a way to calculate the second order work for this kind of beam element
with the data given.
Literature
[1] R. Hill, On uniqueness and stability in the theory of finite elastic strain.
journal of the Mechanics and Physics of solid, V. 5, 4, pp. 229–241, 1957.
[2] Information form the Plaxis manual on beam element defition based on
Mildlin plate theory.
[3] [Link]
NFEM.Ch11.d/[Link].d/[Link]
25
Problem 7. Mathematical Model of
Residential Storage Water-heating System
MelissaClimate, [Link]
• know your preferences and habits / will know what’s needed to make you
comfortable;
• analyze your heating & cooling systems in order to make them more energy-
efficient.
Introduction
The low-cost commonly available water heater is inherently a lossy device and
this means that a good percentage of the energy consumed heating water ends
up being lost as heat to the surroundings. Informal measurements and practice
show that if a family of four persons switches on and off the water heater just
when required savings of up to 80% are recorded.
Our goal is to use model of the water heater to perform energy saving cal-
culations and help the customer operate their water heaters in the most energy-
efficient way.
Modelling is nothing but converting physical information in to mathematical
form. Mathematical model plays vital role for identification and analysis of the
system. The model updates the simulated temperature of the mass of water
periodically where the rate of change in temperature depends on the system
inputs, outputs and losses.
ESGI’120 Mathematical Model of Residential Storage Water-heating System
• The water heater model should simulate the temperature variations over
time.
• For the model we can assume that the user has set the mechanical thermo-
stat to 70 ◦ C.
• The model should take into account that the temperature in the tank is
updated by:
27
Mathematical Model of Residential Storage Water-heating System ESGI’120
Fig. 2
28
FINAL REPORTS
Multi-frame Denoising of Still Images
Stanislav Harizanov, Dimo Dimov, Nikola Naidenov, Savka Kostadinova
1. Problem formulation
The representative of MM Solutions AD Mr. Angel Ivanov posted the follow-
ing problem to the European Study Group with Industry’120 (ESGI’120): “A
sequence of 8 images are captured quickly one-by-one while camera is held in hand
and unintentional hand shake is present. When capturing in low light conditions,
the images appear blurred and noisy. The target is to combine multiple frames
to produce an image with less noise and less (ideally no) blur. The processing
algorithm should not be too computationally expensive.”
On Fig. 1 one of the captured image frames is illustrated. One can see that
the input data are of high resolution (2592 × 4608 pixels) and contain great
variety of shapes and patterns. Indeed, there are figures, letters, shiny objects,
texture, moving objects, repetitive patterns, etc. The noise is “pink”, typical for
Multi-frame Denoising of Still Images ESGI’120
electronic circuits like the analog amplifiers embedded in the image sensor. It is
Gaussian, but not white, since low frequency amplitudes are higher. The blur
kernel changes smoothly within the image due to the predominantly rotational
camera shake and the usage of rolling shutter in the image sensor.
The first half of this report is devoted to multi-frame denoising. We construct
and numerically solve a penalized energy-minimization optimization problem.
The efficiency of the proposed algorithm lies on the observation that our multi-
frame denoising approach is equivalent to a single-frame one, for which the in-
put image is the corresponding convex combination of the eight original frames.
Therefore, we do not need additional memory resources when the number of
frames increases and the execution time is also independent of this number.
Apart from blur, hand shake causes the images not to be aligned to each
other. Alignment was not part of that project as the given images were already
pre-processed and an algorithm, which aligns the images with up to 2pix error
at 4000 × 3000 image resolution, had already been applied. Nevertheless, in the
second half of this report we perform our own alignment on the raw data, based on
inverse filtering. This allows us to determine the hodograph of the frame centers
(see Fig. 10), thus it provides us with additional information on the characteristics
of the hand shake, respectively of the blur kernel.
The box constraint u ∈ [0, 255]N is due to input data characteristics, namely we
are given 8-bit gray-scale bitmap images. Here N corresponds to the image size.
Note that the gray-scale intensity of the output ū is not integer-valued as the
discretized version of (1) is hard and numerically expensive to solve. Instead, as
post-processing, we round the intensity value of each pixel to the nearest integer.
The regularization term k |∇u| k1 measures the total variation (TV) norm
of the discrete gradient ∇ of u. For the computation of ∇u we use forward
finite differences and Neumann boundary conditions. This energy norm, also
known as mixed ℓ2,1 norm since it is the sum of the Euclidean lengths of the 2D
pixel-wise intensity gradients, was first introduced in [1]. The authors showed
32
ESGI’120 Multi-frame Denoising of Still Images
improved robustness of such type of filters towards the input image noise in
comparison to the corresponding standard ℓ2 -based filters and until now the TV
norm remains the most favorite choice for a regularization term in optimization
denoising models.
The data fidelity term m 2
P
i=1 λi ku−fi k2 controls the regularization process. Its
choice is statistically motivated, as least-squares are the Maximum Likelihood Es-
timate for Gaussian-modeled noise. The penalizers {λi }m 1 are free, non-negative
parameters (weights) that are manually chosen by the user. The higher the λi the
smaller kū − fi k22 , thus the closer ū to fi . Choosing adequate values for the penal-
izers is crucial for the quality of the result. Too large λi gives rise to incomplete
noise removal, while too small λi leads to oversmoothening of the output and
loss of important structural information. Later, we propose a practical algorithm
how to optimize these values.
P
Let Λ = i λi . Since
m m
X λi X
Λku − fi k22 − λi ku − fi k22 =
Λ
i=1 i=1
* m
+ m 2 m m m
X λi X λi X X X
Λkuk22 −2Λ fi , u +Λ fi − λi kuk22 +2 λi hfi , ui− λi kfi k22
Λ Λ
i=1 i=1 2 i=1 i=1 i=1
m 2 m
X λi X
=Λ fi − λi kfi k22
Λ
i=1 2 i=1
33
Multi-frame Denoising of Still Images ESGI’120
In other words, for each Λ > 0 there exists a unique τΛ > 0 such that the
minimizers of (2) and (3) coincide. The constrained formulation of the optimiza-
tion problem allows us to analyze existence and uniqueness of the minimizer.
It is well known that as long as the constrained set is non-empty and do not
contain a global minimizer of the cost function, problem (3) has a unique solu-
tion that lies on the boundary of the constraint. Since the global minimizers of
k |∇u| k1 are the constant images and the constrained set is never empty (the
input image is always inside) we conclude that there exists Λmin > 0 such that for
every PΛ > Λmin problem (2) admits a unique solution that additionally satisfies
ku − m λi 2
i=1 Λ fi k2 = τΛ .
Apart from the well-posedness of the mathematical problem, the above anal-
ysis gives us another perspective, namely we realize that ū is the most regular
image (with respect to the TV norm) on the intersection of an N -dimensional
√
sphere of (unknown) radius τΛ , centered at the convex combination m λi
P
√ i=1 Λ fi
N
of input frames, and the N -dimensional cube [0, 255] . The radius τΛ needs to
be small enough so that no constant images lie inside the ball, thus Λ needs to
be big enough (the Λ ↔ τΛ correspondence is reciprocal).
In theory, we do not know how to exactly estimate Λmin , but from a practical
point of view the check if the chosen Λ is admissible or not is quite simple -
we just check if the output ū is constant or not. Anyway, we are interested in
Λ ≫ Λmin since we want to preserve all the edges of the input image and not to
oversmoothen it, therefore the theoretical peculiarities around Λmin are outside
the scope of our application.
of (1). Here, ι[0,255]N is the indicator function of the N -dimensional cube [0, 255]N ,
which takes value 0 inside the set and +∞ outside it.
34
ESGI’120 Multi-frame Denoising of Still Images
Algorithm 0.0.1 (ADMM) Input: {fi } (a sequence of input frames) and {λi }
(the corresponding weights). Output: u = xK (denoised image).
For k = 1, . . . , K. n o
(k) (k) (k) (k)
1. x(k+1) = argminx ι[0,255]N (x) + γ2 kb1 +Lx−y1 k22 + kb2 +x−y2 k22
n o
(k) (k) (k) (k)
x(k+1) = P[0,255]N (I + LT L)−1 (LT (y1 − b1 ) + (y2 − b2 )) .
n o
(k+1) (k)
2. y1 = argminy ky1 k1 + γ2 kb1 + Lx(k+1) − yk22
(k+1) (k)
y1 = I − PBk·k∗ (1/γ) (b1 + Lx(k+1) ).
nP o
(k+1) m 2 γ (k)
(k+1) − yk2
3. y2 = argminy i=1 λi ky − fi k2 + 2 kb2 + x 2
!
(k+1) 1 (k)
X
y2 = γ(b2 + x(k+1) ) + 2 λi fi
γ + 2Λ
i
The algorithm theoretically converges for any choice γ ∈ (0, 1) of its free
parameter. In general, tuning γ may improve the convergence rate, but in our
particular setting we didn’t observe significant influence of the γ value on it.
Therefore, we always set γ = 0.3 in our experiments. We also set K = 150.
In Step 1. we use direct numerical solver for the linear system
(k) (k) (k) (k)
(I + LT L)−1 (LT (y1 − b1 ) + (y2 − b2 )).
35
Multi-frame Denoising of Still Images ESGI’120
Compared to the noisy input, the resulting image has no visible noise, yet all
the objects in it are clearly visible and do not look artificial (little high-frequency
noise creates an impression of sharper edges and the human brain classifies the
image as “good looking”). The only problem is the desktop screen, which contains
moving objects. There the multi-frame denoising gives rise to additional motion
blur and the output is fuzzy and unnatural. We will address this problem later
in the section.
Measuring the TV norm of inputs and output gives us a quantitative infor-
mation regarding the quality of the denoising process. Indeed, the TV norm of
the five individual input frames varies between 8.92e+07 and 1.34e+08, the TV
norm of the averaged input image is 5.36e+07, while the TV norm of the de-
noised output is only 1.77e+07. By definition, noise is unstructured and highly
irregular. Therefore, energy decrease is a strong evidence of successful denoising.
36
ESGI’120 Multi-frame Denoising of Still Images
Figure 3. Visual and energy comparison of various input and output images
37
Multi-frame Denoising of Still Images ESGI’120
Note that, when all the λi are equal, they are exactly λi = Λ/m. Now, for every
i = 1, . . . , m we generate the averaged output (u1 + · · · + ui )/i and compute its
38
ESGI’120 Multi-frame Denoising of Still Images
TV norm. If the TV norm gradually decreases when i increases then the chosen
Λ is too large and there is still residual noise in the outputs ui , see Fig. 5. The
largest Λ for which the TV norm remains stable during the averaging process is
the optimal one.
A very important remark here is that, unlike the input scenario where taking
a multi-frame input (1) or its corresponding single-frame convex combination (2)
does not affect the output, the averaged image ( m
P
i=1 ui )/m significantly differs
from the minimizer ū of (2) for the same Λ. The reason is hidden in (3) and the
non-linear relation Λ ↔ τΛ between penalizers and constraints. We observe that
τΛ/m ≫ mτΛ so the constrained set that corresponds to the single-frame denoising
process is too large and gives rise to oversmoothed solutions ui . Comparing the
39
Multi-frame Denoising of Still Images ESGI’120
numerical results on Fig. 3 with the numerical results on Fig. 5 we confirm the
above argument. 5
P5 Indeed, for Λunder = 6 · 10 we have 5T V (uunder ) = 3.85e+06,
while T V (( i=1 ui )/5)P= 3.35e+06. For Λexact = 10 we have T V (uexact ) =
2.74e+06, while T V (( 5i=1 ui )/5) P= 2.14e+06. For Λunder = 2 · 104 we have
T V (uover ) = 2.02e+06, while T V (( 5i=1 ui )/5) = 1.17e+06. Therefore, the pro-
posed multi-frame denoising approach is conceptually better than simply averag-
ing single-frame denoised images.
Finally, we make a short discussion on how to get rid of the additional motion
blur in moving objects. Since our denoising approach is based on data regular-
ization, the blur characteristics do not improve throughout the process and the
output might be even blurrier than the input. This is especially the case with
moving objects as the text on the desktop in the bottom left corner of the original
frame, see Fig. 1. Therefore, if we want to control the blur impact it is better
to apply single-frame denoising to the least blurry input frame as illustrated on
Fig. 6. Since the noise is predominantly “pink”, its characteristics are strongly
related to the camera parameters and should not change from frame to frame,
when the camera parameters remain untouched. Hence, in absence of blur, the
TV norms of all the frames fi should be alike. However, the hand-shakes in
between the frames change their direction and amplitude and so does the blur.
40
ESGI’120 Multi-frame Denoising of Still Images
41
Multi-frame Denoising of Still Images ESGI’120
Blurring is also a form of data regularization, so the input frames with higher
TV norm possess less blur. When we apply single-frame denoising to the frame
with largest TV norm (in our case this is f2 ) and with λ, larger than the optimal
one Λexact /m we are in an undersmoothing regime but we control the blur (see
bottom, left of Fig. 6). The choice of f2 is significant, because if we take the
blurriest frame f5 that has the smallest TV norm we end up with a quite blurry
output (see bottom, right of Fig. 6).
42
ESGI’120 Multi-frame Denoising of Still Images
two frames (it can be considered like a “video stabilization” problem, see [2]), we
have to model only the movement noise by the formula, [3]:
T
sin(π~u ◦ ~τ )
Z
(4) H(~u) = exp(−j 2π~u ◦ (~τ /T )t)dt = T exp(−jπ~u ◦ ~τ ),
0 π ~u ◦ ~τ
where H(~u) is the Fourier spectrum of the modelled noise, ~u is an arbitrary vector
in the frequency domain R2 , ~τ /T is the velocity of the image caused by camera
movement (an uniform rectilinear motion) during the time interval (0, T ] of open
shutter, j 2 = −1, and ~u ◦ ~τ is the scalar product of the vectors.
For the length of the time interval we have T = µ/hf psi where hf psi is the
value of the parameter “frames per second” of the camera, and µ, 0 < µ < 1 is
a specific constant of the camera. On account of electronic realization, the time-
interval (1− µ)/hf psi of closed shutter is (or can be selected) negligible compared
to T . So, in our case we will take µ ≈ 1, i.e. T = 1/hf psi. For definiteness we
will assume that hf psi = 15s−1 , i.e. T = 0.066s. Actually, if we normalize the
considered images according to their intensity (which is an established practice),
then we can exclude T from consideration, accepting that T ≡ 1.
This model of the noise reflects the physical interpretation of blurring the
image in a given frame fi , as a uniform accumulation of the scene captured
during the time of exposure, starting from an empty accumulator (i.e. the 2D
input pixel matrix of the camera) in the position of the previous frame fi−1 . This
means that we can use the “inverse filtering” approach (see [3]) to get a restored
version fˆi of the frame fi relatively to the position of the previous reference frame
fi−1 , namely:
F(fi )(~u)
(5) F(fˆi )(~u) = , ~u = (ux , uy ) ∈ (X × Y ) ⊂ R2 ,
H(~u)
where F(fˆi ) and F(fi ) are the Fourier-spectra of fˆi and fi , respectively.
−1
However, the direct inverse filtering H(~u) does not work properly if there
is external noise (beyond that caused by motion), for example, noise from temper-
ature and/or wind conditions in the real scene, moving objects therein, distortion
of optics, etc. For those real situations, there are known additional filtering ap-
proaches (of high frequencies suppression) like Gauss filter, Butterworth filter,
Wiener filter, etc., [3].
Indeed, the 2D surface |H(~u)|, i.e. modulus of the filter H(~u), is a 2D cylinder
of element curve: T. Sinc(α) = T sin(α) α , α ∈ R, which direction is π/2 rotated
towards the shift ~τ , and into this direction the filter asymptotically approaches
43
Multi-frame Denoising of Still Images ESGI’120
zero:
τx k
(6) |H(~u)| = 0 ⇒ ~u ◦ ~τ = k ⇔ uy = − ux + ,
τy τy
where the filter H(~u), see (4), now has the desired property of “suppressing the
high frequencies” (see Fig. 7 to compare the spectra).
At this stage, the experiments confirm the above heuristics, which we will con-
sider as a practical innovation only, whose theoretical confirmation (or rejection
for some cases) is left for a future work.
44
ESGI’120 Multi-frame Denoising of Still Images
Figure 7. Spectrum of filters H and H −1 : First row: spectra of the Fourier modules of
the direct (left, (a)) and the inverse (right, (c)) filters; Second row (b,d): 1D element
curve of the corresponding spectra, which are 2D cylinders. For better visualization a
purely horizontal shift ~τ = (τx , 0) is chosen
45
Multi-frame Denoising of Still Images ESGI’120
2. Perform the inverse filtering to obtain the restored image fˆi of the current
frame: fˆi (x, y) = F −1 (F(fi ) · Hi ), (x, y) ∈ (X × Y ), where:
sin(π~u ◦ ~τi )
Hi = Hi (~u) = T exp(−jπ~u◦~τi ), ~u◦~τi = ux τx +uy τy , ~u ∈ (X×Y ).
π ~u ◦ ~τi
Normalize fˆi by average (or maximum) value of the intensity (to reach
T ≡ 1):
X X Y
ˆ sum{fi } X
fi (x, y) = fi (x, y) , (x, y) ∈ (X × Y ), sum{f } = f (x, y).
sum{fˆi } x=1 y=1
46
ESGI’120 Multi-frame Denoising of Still Images
3. Estimate the effect of the proposed filtering of motion noise through the
image triads: the current input fi , the restored one fˆi and the previous
fi−1 :
• Preliminary translate the restored image fˆi to the position of the
current fi , i.e. by the vector ~τ /2. This translation can be thought al-
ready done at the previous step 2 in the frequency domain via the formula
F(tran{f, ~τ /2}) = F(f ) exp(−jπ~ u ◦ ~τ /2), or directly
in the object domain
τx τy
through: tran{f (x, y), ~τ /2} = f x + 2 , y + 2 . In the second case, we
have to care about the content of emptied (opposite to the translation)
horizontal and vertical end-stripes in the translated image.
• Calculate PSNR (Peak Signal-to-Noise Ratio) for the pair (fi , fˆi ):
psnr1 (i) = psnr(fˆi, fi ), where psnr(g, f ) is defined like in [4]:
1 X X X Y
psnr(g, f ) = 20. log 10 (255)−10. log 10 (g(x, y)−f (x, y))2 [dB].
X.Y x=1 y=1
The behavior of the quantity q(i) for different pairs of consecutive frames
(fi−1 , fi ) allows to estimate the effect of the proposed filtering of the noise from
camera movement. We expect that q(i) > 0 (the more, the better :).
3. Translate fˆi at the reference point (x0 , y0 ) and accumulate it in fˆ0 , i.e.
currently fˆ0 = fˆ0 + fˆi .
47
Multi-frame Denoising of Still Images ESGI’120
6. The complete reconstructed (restored) image is fˆ0 = fˆ0 (x, y), (x, y) ∈ (X ×
Y ) ⊂ R2 . End.
(tAvg): Like (sAvg), but before summing up the current frame fi , i ∈ {2, . . . , n}
it is translated at the point (x0 , y0 ). Finally, the result is normalized by (n − 1):
n
1 X
f(tAvg) (x, y) = fi (x − x0 , y − y0 ).
n−1
i=2
48
Table 1. Quality rating (in several parameters) for the sequence “mdp 8Lux”: first part – for each pair
(i ↔ i) = (fi−1 → fi ), i = 2, . . . , 8; and second part – for several sub-sequences in lengths: 2, 3, 5 and 8.
ESGI’120
Table 2. Quality rating (in several parameters) for the sequence “mdp 8Lux (cut-off)”, i.e. clipped frames: first part –
for each pair (i ↔ i) = (fi−1 → fi ), i = 2, . . . , 8; and second pat – for several sub-sequences in lengths: 2, 3, 5 and 8.
49
Multi-frame Denoising of Still Images ESGI’120
in this test sequence (mainly because the results of motion noise suppression are
positive).
The original sequence “mdp 8Lux” has a frame size of [4160 × 3120] pixels.
This relatively high dimension make difficulties experimenting more precise meth-
ods and approaches for noise removal, presented in Section 2 of the report. For
the purposes of the common analysis of the results, we use also a reduced version
of “mdp 8Lux”, namely “mdp 8Lux (cut off)”, whose frame size is [1285 × 965].
The result of the complete reconstruction (Mine), on the all 8 frames of
“mdp 8Lux” is illustrated in Fig. 8a, where the reference point is the center
of the first frame f1 . The intermediate results of the evaluation of the shifts
~τ = (τx , τy ) between the pairs of consecutive frames (fi−1 , fi ), i = 2, . . . , 8 are
given in Fig. 8b, where the positions of the frames are marked by “circles”, and
those of the basic reconstructions in between – by “stars”.
On Fig. 9 some simple reconstructions are shown, namely, (sAvg), (tAvg) as
well as the absolute value of their differences to (Mine) (depicted in Fig. 8a).
Visually, the resulting images and comparisons between them is better to be
looked by a professional Image-Editor|Viewer. The video improvement tools of
MSWord just gloss over these details, that we want to emphasize, i.e. the actually
better results look worse, that’s why, please, follow simultaneously the attached
50
ESGI’120 Multi-frame Denoising of Still Images
Figure 9. Two more possible reconstructions: Left: Simple summation of all images of
the original series, with the final result translated to (0,0) (top, (a)); each image is
translated to (0,0) before summation (bottom, (b)). Right (c,d): the absolute
differences between the left images and the main reconstruction (see Fig. 8). For better
visibility the difference pictures are amplified to maximal intensity. The mean of case
(a) is about 3 times higher than the mean of case (b), see also Table 2
51
Multi-frame Denoising of Still Images ESGI’120
52
ESGI’120 Multi-frame Denoising of Still Images
References
[1] L. I. Rudin, S. Osher, and E. Fatemi. Nonlinear total variation based noise
removal algorithms. Physica D, 60:259–268, 1992.
[2] D. Dimov and A. Nikolov. Real Time Video Stabilization for Handheld
Devices. ACM International Conference Proceeding Series 833, 124–133,
ACM Digital Library, 2014.
ISBN:978-1-4503-2753-4, DOI:10.1145/2659532.2659631.
53
Two Dimensional Optimal Cutting Problem
Ana Avdzhieva, Todor Balabanov, Georgi Evtimov,
Ivan Jordanov, Nikolai Kitanov, Nadia Zlateva
Abstract
At the 120-th European Study Group with Industry engineering company
“STOBET” Ltd set the problem of optimizing the process of arranging plates with
different shapes on a steel sheet. This report describes the methods proposed by
the study group, and the conclusions drawn from the study of these approaches.
Key words: Two dimensional cutting stock problem, genetic algorithm, greedy
algorithm
1. Introduction
Engineering company “STOBET” Ltd creates projects for buildings and struc-
tures.
Having a lot of such projects, the company wants to improve the quality of the
product and to reduce the price of the process of its realization. “STOBET” Ltd
uses software for design of steel constructions. The software produces drawings
ESGI’120 Two Dimensional Optimal Cutting Problem
of the different needed plates. After making all drawings, the task is to deploy
optimally all plates on a minimal number of standard steel sheets.
For any plate only the coordinates of its vertices are known. Let, for example,
are given n plates with their coordinates:
• ...
55
Two Dimensional Optimal Cutting Problem ESGI’120
2. The approaches
Three different approaches to the two dimensional cutting problem in hand
are considered by the group.
56
ESGI’120 Two Dimensional Optimal Cutting Problem
3. Results
Some experimental tests with real data were made using the suggested mod-
ified genetic algorithm. One of them is shown on Fig. 3. The total waste was
decreased to 19%.
For a concrete example a genetic algorithm was applied to two-dimensional
topology of polygons. The result was worse. The total wastage of the steel sheet
was 21.30%.
We have some difficulties to implement the greedy algorithm.
57
Two Dimensional Optimal Cutting Problem ESGI’120
References
[1] Ana Avdzhieva, Todor Balabanov, Detelina Kirova, Hristo Kostadinov,
Tsvetomir Tsachev, Stela Zhelezova, Nadia Zlateva, Optimal Cutting Prob-
lem, 113-th European Study Group with Industry, September 14–18, 2015,
Sofia, Bulgaria, Problems and Final Reports, Fastumprint, 2015, 49–61.
58
Authenticity Management Algorithm for
Digital Images
Todor Balabanov, Peter Dojnow, Vasil Kolev, Nikolai Manev, Walter
Mudzimbabwe, Petar Tomov, Ilian Zankinski, Stela Zhelezova
Abstract
Nowadays network services are gaining great attention. Therefore authentica-
tion of media content is very important. For the considered problem, the group
propose an algorithm with client-server architecture. The chosen digital signature
algorithm is based on image content and is according to NIST specifications. The
most important parameters for an effective tampering detection are discussed.
Key words: authentication, watermarking, tampering detection
1. Introduction
Image authentication is of great importance due to the large number of mul-
timedia applications in various fields. Currently, the amount of digital images
transmitted over non-secure channels is growing rapidly. Therefore, the protec-
tion of image integrity is of great interest.
A digital watermark is called robust if it resists a designated class of trans-
formations and it is imperceptible if the watermarked content is perceptually
equivalent to the original one.
There are active and passive image authentication methods. The active meth-
ods extract some information of the image to be authenticated while the passive
ones perform the authentication without needing previous information about the
authenticated image. Active methods include watermarking and hashing based
methods. We extract the needed authentication and tampering detection in-
formation from the original picture so we use active methods for the proposed
algorithm.
With respect to the embedding method there are different watermarking tech-
niques. Some of them embed message in spatial domain. Other methods use
message embedding in a frequency-based representation of a digital image. The
proposed authentication schema uses spatial domain.
Because of the particular case in which the watermarking is considered, we
employ steganographic technique to embed data. Least Significant Bit (LSB)
hiding is one of today’s easiest techniques for image steganography. It imply
Authenticity Management Algorithm for Digital Images ESGI’120
adding some secret information in the least significant bits of the image pixel. The
image quality is distorted for the number of bits embedded in a pixel greater than
3. However, such a technique is very insecure because the watermark can be easily
destroyed. But for our problem, the most desirable property is imperceptibility
to human senses than robustness therefore it is appropriate. The creation of
robust and in the same time imperceptible watermarks has proven to be quite
challenging [3].
In the case of mobile devices the signature scheme must be efficient enough
without delays. We choose to develop a simple image authentication scheme.
60
ESGI’120 Authenticity Management Algorithm for Digital Images
2. Our Approach
2.1. Initial statements
The entire algorithm consists of two main steps:
• Size of the original image n × m pixels in Bitmap. Minimal size: 1024× 768.
This is the worst case, because the hidden bits place is proportional to the
image size.
• Content: interior and car pictures. The content is important in the con-
nection with the hiding bits methods. If the image content is almost the
same, i.e. the colors are evenly distributed, hiding of information is much
more difficult.
61
Authenticity Management Algorithm for Digital Images ESGI’120
62
ESGI’120 Authenticity Management Algorithm for Digital Images
for particular image and user. The algorithm parameters are: q – N -bit prime,
p − L-bit prime, p − 1 is a multiple of q, g – its multiplicative order modulo p is q.
The NIST recommend in Federal Information Processing Standard (FIPS) 186-3
key length pairs (2048, 256), and (3072, 256) for (L, N ) – the associated pair of
length parameters for a DSA. The algorithm parameters can be used as they are
implemented in library according to some provider (as SUN) for instance. Also
the DSAParameterSpec class can be used to chose specific (p,q,g) parameters.
A particular key pair is generated by KeyPairGenerator class. At this step
the String algorithm (we choose DSA) have to be specified. To initialize two
arguments are needed: the key length Lk and the source of randomness. For
the second parameter the threadedSeedGenerator have to be used several times
with different parameters, each of them connected with the particular user, device
and time parameters.
So the next input element the algorithm needed is the private key k with
length Lk = 2048 bits, k – random, 0 < k < q and the public key y = gk mod p.
Signing
Message digests are secure one-way hash functions that take arbitrary-sized
data and output a fixed-length hash value. The standard Message Digest (MD)
algorithms are for example MD5, SHA-1, SHA-256 etc. Bear in mind that the first
two are compromised [3], [8] for the implementation of the proposed algorithm we
suggest SHA3-256, SHA3 is the newest one but it has BITE-only implementation
in Java so the length of input sequence has to be divisible by 8. It takes as input
ZBIs and gives as output |MD| = 256 bits. A common way to sign things is the
63
Authenticity Management Algorithm for Digital Images ESGI’120
Digital Signature Algorithm. The signing is done in Signature object from the
Signature class with the following steps:
• Get a Signature object – the signature algorithm name is specified and the
the name of the message digest algorithm used by the signature algorithm
is specified. SHA3-256withDSA is a way of specifying the DSA signature
algorithm, using the SHA3-256 message digest algorithm (Spongy Castle
Crypto package).
• Supply the Signature object the ZBIs to be signed – the update method
of the Signature object is called.
Now the DS and public key are ready to be sent to the server. Usually they
are stored in additional files and sent separately. The proposed algorithm embed
DS in the ZBIs . We store DS not in each 3-LSB but in each (n.m) mod LDS
3-LSB according to PATH permutation. The public key is added at the end of
SWIs .
64
ESGI’120 Authenticity Management Algorithm for Digital Images
65
Authenticity Management Algorithm for Digital Images ESGI’120
Tampering detection
At this step the algorithm compares the extracted CRC16V values and CRC16
words obtained from the received ZBIs . If the image is not tampered it returns
“true”. Then applying on ZBIs the inverse permutation PATH−1 , ZBI is obtained.
It is not the original image, but perceptually indistinguishable.
In the other case, the pixels with wrong CRC16 values have to be considered
as tampered and a new two color image (the same size as OI) can be done – with
black color only at tampered pixels.
Conclusions
We propose a signing and watermarking schema suitable for the features of a
particular business problem. The parameters and tools are chosen according to
the newest scientific achievements. The experiments with real data are needed in
order to evaluate the lowest possible SN R for different parameters and to ensure
the best performance of the algorithm. The real media environment have to be
considered to supply the algorithm with error protection during the transmission.
66
ESGI’120 Authenticity Management Algorithm for Digital Images
References
[1] Baicheva, T., Dodunekov, S., Kazakov, P., Undetected error probability per-
formance of cyclic redundancy-check codes of 16-bit redundancy, IEE Proc
Commun., 147 (5) 2000, 253–256.
[2] CERT Vulnerability Note VU# 836068, [Link]., December 31, 2008.
[3] Cox, I. J., Miller, M. L., Bloom, J. A., Fridrich J., Kalker, T.: Digital wa-
termarking and steganography. Morgan Kaufmann, Burlington, MA, USA,
2008.
[5] Liu, Z., Li, Q., Zhang, H., Peng, X., An Image Structure Information based
Robust Hash for Tamper Detection and Localization, Sixth International
Conference on Intelligent Information Hiding and Multimedia Signal Pro-
cessing. Darmstadt, Germany, 430–433.
[6] [Link]
[7] Rinu Tresa M. J., Athira M. B., Sobha T., A novel steganographic scheme
based on hash function coupled with AES Encryption, Advanced Computing:
An International Journal, 5 (1) (2014).
67
Laboratory Calibration of MEMS Rate
Sensors
Tihomir Ivanov, Galina Lyutskanova, Dragomir Aleksov, Ognian Kounchev
Abstract
In this paper, we suggest a simple algorithm for calibrating microelectrome-
chanical systems (MEMS) accelerometers. We use a classical relation, depending
on 12 parameters, between the raw output from the sensors and the calibrated
data, as well as a more complicated relation, derived from physical and geomet-
rical considerations. We obtain the calibration parameters by formulating and
solving a least-squares problem. Results of numerical experiments are shown to
validate the proposed algorithm.
Key words: MEMS accelerometers, sensors, calibration algorithms, parameter
identification, reverse problem.
1. Introduction
In directional drilling, the orientation of the borehole is determined by mea-
suring three angles—toolface, inclination, and azimuth angles (see Fig. 1). In
the present work, we are interested in the problem of measuring the first two of
them.
As far as miniature dimensions and full measurement range are concerned, the
most advantageous solution is a sensor made of commercial microelectromechan-
ical systems (MEMS) accelerometers, which employs measurements of the three
Cartesian components of the vector of gravitational acceleration [4].
Let us denote the acceleration vector, acting on a three-axial accelerometer
sensor, with
a = (ax , ay , az )T .
When the device is in still position, it should be measuring only the gravitational
acceleration. Then, using simple geometric considerations, the toolface (tf ) and
inclination (incl) can be easily computed, as follows:
(
360◦
(1) tf (a) = 2π atan2(ay , ax ) if atan2(ay , ax ) ≥ 0,
◦
360◦ + 360
2π atan2(ay , ax ) otherwise,
where
arctan( xy ) if x > 0,
arctan( xy ) + π
if x < 0 and y ≥ 0,
arctan( y ) − π
if x < 0 and y < 0,
atan2(x, y) := x
π
+ 2 if x = 0 and y > 0,
π
− 2 if x = 0 and y < 0,
undefined if x = 0 and y = 0.
The latter function computes the angle, which the segment through the point
(x, y) and the origin makes with the positive x-semi-axis.
Let us remark that when using formula (1) in computer arithmetics, it is
wise to substitute the condition for the first case on the right-hand side with
atan2(ay , ax ) ≥ −ε for some ε > 0, in order to avoid large errors for near-zero
angles.
The inclination is given by
r
360◦ a2x +a2y 360◦
90◦ −
2π arcsin a2x +a2y +a2z if 90◦ − 2π arccos √ az
> 60◦ ,
a2x +a2y +a2z
(2) incl(a) =
360◦
90◦ −
2π arccos √ az
otherwise.
a2x +a2y +a2z
69
Laboratory Calibration of MEMS Rate Sensors ESGI’120
The deterministic error sources include the bias (offset) and the scale factor
errors [2]. Another issue lies in the fact that formulae (1) and (2) are only valid
if the three axes of the sensor are perfectly orthogonal. This, however, can never
be the case in practice. The random errors include bias-drifts or scale factor
drifts, and the rate at which these errors change with time. Furthermore, all the
errors are sensitive to different environmental factors, especially to temperature
variations [1].
In the present work, we are interested in the initial calibration in laboratory
conditions of the deterministic sources of error. More specifically, we suggest an
algorithm for compensating the errors due to nonorthogonalities, shifts and scale
factors.
Apart from this, random errors should be accounted for by using an appro-
priate stochastic model. Many authors suggest using Alan variance as a tool for
studying those errors [6]. Also, a temperature model should be used to account
for the temperature variations.
2. Calibration approaches
As formulated, e.g., by Aggarwal et al. (2008), calibration is the process of
comparing instrument outputs with known reference information and determining
the coefficients that force the output to agree with the reference information over
a range of output values [2].
Thus, we can divide the problem into two sub-problems:
1. propose a model, relating the raw output data from the sensors to the “real”
components of the acceleration vector with respect to some orthonormal
coordinate system;
(3) a = M.â + b.
70
ESGI’120 Laboratory Calibration of MEMS Rate Sensors
wherein the diagonal elements account for the scale factors and the off-diagonal
elements—for the errors due to non-orhogonalities. The vector
bx
b = by
bz
where
tx 0 0 bx
T = 0 ty 0 , b = by ,
0 0 tz bz
2
− sin θ cos φ − cos θ cos ψ cos ψ − cos φ cos θ
1
T= cos φ − cos θ cos ψ − sin2 ψ cos θ − cos φ cos ψ ,
den
cos ψ − cos φ cos θ cos θ − cos φ cos ψ − sin2 φ
den = −1 + cos2 φ + cos2 ψ + cos2 θ − 2 cos φ cos ψ cos θ,
1 cos φ cos ψ
0 sin φ cos θ − cos φ cos ψ
orth
T =
sin φ .
p
1 − cos2 φ − cos2 ψ − cos2 θ + 2 cos φ cos ψ cos θ
0 0
sin φ
In the above expressions, the 9 parameters have the following meaning. The
three scaling coefficients are denoted by tx , ty , tz , the offsets on the respective
axes are denoted by bx , by , bz and ϕ, ψ, θ are the angles between the directions
defined by the three axes of the MEMS accelerometer. Let us remark that those
angles should be close to 90 degrees.
71
Laboratory Calibration of MEMS Rate Sensors ESGI’120
2 2
kM.âx + b − (g, 0, 0)T k kM.ây + b − (0, g, 0)T k
ε(M, b) = +
g g
(5) 2 s
kM.âz + b − (0, 0, g)T k
X kM.âi + bk − g 2
+ + .
g g
i=1
3. Numerical results
We are given raw accelerometer outputs obtained in 32 different positions of
the sensor, see Table 1. For each position, the toolface and the inclination of the
device are known. We use the first 20 of them (the shaded rows in the table) to
calibrate the device and the rest is used as a test set. Let us remark that we only
give here results from one data set, since other experiments we have carried lead
to similar conclusions.
First, we calibrate the sensors, using model (3). For solving the minimization
problem (5), we use the Wolfram Mathematica function N M inimize. The results
are presented in Table 2. In all cases the computed toolface and inclination is
within less than 2◦ from the real value. Let us remark that when the inclination
72
ESGI’120 Laboratory Calibration of MEMS Rate Sensors
equals 90◦ , the toolface cannot be computed, because the function tf (a) is not
defined, when ax = ay = 0 holds true.
Next, we compare the latter results with those, obtained using model (4), see
Table 3. The obtained accuracy is very similar, even slightly worse. On the
other hand, the model (4) leads to a much more complex nonlinear minimization
problem to be solved. Further experiments should establish if there are cases when
73
Laboratory Calibration of MEMS Rate Sensors ESGI’120
Table 2. Results from the calibration, using the linear model (3)
the seemingly more accurate model (4) should be preferred. The current state
of our research, however, suggests that the basic relation (4) gives comparable
results and, thus, should be preferred because of its simplicity.
74
ESGI’120 Laboratory Calibration of MEMS Rate Sensors
Table 3. Results from the calibration, using the linear model (3)
75
Laboratory Calibration of MEMS Rate Sensors ESGI’120
References
[1] P. Aggarwal, Z. Syed, X. Niu, N. El-Sheimy, Thermal Calibration of Low
Cost MEMS Sensors for Integrated Positioning, Navigation Systems, The
Institute of Navigation National Technical Meeting (2007) 22–24.
[6] H. Hou, Modeling inertial sensors errors using Allan variance. Library and
Archives Canada, 2005.
76
Future Cyber Attacks
Modelling & Forecasting
Zlatogor Minchev, Georgi Dukov, Doychin Boyadzhiev, Plamen Mateev
1. Problem Definition
Following leading industrial experience approaches for cyber intelligence in-
trusion & threats exploration (see e.g. [1], [2]), jointly with some recent research
results, concerning the problem area (to note [3], [4]) three key steps have been
arranged for future cyber attacks studying: (i) establishment of cyber risks land-
scape, implementing both intrusions and attack vectors due to expert, and litera-
ture data; (ii) supportive models for multiple intrusions risk reassessment towards
expected attack vectors; (iii) experimental application of (i) & (ii) results for cy-
ber risks landscape evolutionary prognosis. Practical realization of these steps
with more details will be further outlined.
i = 1 ÷ m, j = 1 ÷ n, k = 1 ÷ p, l = 1 ÷ q,
where P (. . . ) are the probability values, calculated for the k−th threat Tk vs
certain l−th attack scenario Sl . The i−th vulnerability Vi and j −th impact Ij values
are taken vs the explored Tk .
The next important exploration stage is (1) practical implementation. This
could be achieved via a probabilistic multiple intrusions modelling towards land-
scape impacts & vulnerabilities with follow-up experimental matching to risk ma-
trix R. The recalculation of expert beliefs is giving new opportunity for threats
T evolution.
Future Cyber Attacks Modelling & Forecasting ESGI’120
The above idea could be expressed with Dirchlet distribution [6], regarding
the multidimensional case as follows:
Y
p
(3) Rf = ak,i .ck,i .rk,i , i = 1 ÷ p, k = 1 ÷ p,
i=1
78
ESGI’120 Future Cyber Attacks Modelling & Forecasting
Y
q
(4) Rb = ak,j .ck,j .rk,j , j = 1 ÷ q, k = 1 ÷ q.
j=1
Y
p
′
(6) Rk,j = Rk,j × Rsi ,j , k ≤ m, i = 1 ÷ p, j = 1 ÷ n.
i=1
The cyber threats landscape probabilities are reassessed after (2) for the
new R′ .
Finally, it is also important to note that the presented ideas have to be con-
sidered and in the dynamic sense (i.e. vs time – t) as the risk assessment is not
a static process, so: R3 → R4 .
4. Experimental Application
The studied context is outlined, following the recent and future trends and
prognosis, noted in [4], [8], [9]. The “Privacy & Social Engineering”, “Malware
& Targeted Attacks”, “Data Breaching & Espionage” and “Compromised by
Design Equipment” were the selected attack vectors, matched vs intrusions from:
“E-mails”, “Social Networks”, “Web Links”, “Data Sharing” and “Chat”. For
further exploration, following the complex nature of modern social networks, the
intrusion models were aggregated around: “E-mails”, “Social Networks” & “Data
Sharing”.
The probabilistic cyber attacks modelling was organized in Matlab R2011b
environment [10].
All modeling and risk probabilistic analyses were performed in I-SCIP-RA,
v.1.0 software environment. The application was developed, following the “Enti-
79
Future Cyber Attacks Modelling & Forecasting ESGI’120
ties” – “Relationships” ideas from I-SCIP-SA [7] and (3)–(5) for suitable proba-
bilistic system risk assessment. Overall model entities graphical classification into
a “System Risk Diagram” was organized as follows: “non-critical” & “critical”,
marked by the north-west/south-east main diagonal of the diagram). Additional
entities system subclassification was made for “active” vs “passive” ones (denoted
consecutively with white & grey colours).
Dynamically, the R4 space of risk models and their relevant classifications of:
Rf , Rb & Rs vs time – t (for a five-step time horizon up to year 2021) was given
further for each attack vectors columns and intrusions rows.
Here it should be noted that the a priori cyber landscape L probabilistic risk
values and three risk system models (“E-mails”, “Social Networks” & “Data Shar-
ing” intrusions) for a posteriori risk reassessment were developed, using Techno-
Logica Ltd. expert data, working group discussions and own research experience.
80
ESGI’120 Future Cyber Attacks Modelling & Forecasting
(ii) Cyber risks landscape L attack vectors a priori (a) and a posteriori (b)
probabilistic distributions
81
Future Cyber Attacks Modelling & Forecasting ESGI’120
82
ESGI’120 Future Cyber Attacks Modelling & Forecasting
(iii.2) Social networks intrusions modelling for cyber risks landscape L re-
assessment
83
Future Cyber Attacks Modelling & Forecasting ESGI’120
(iii.3) Cloud storages intrusions modelling for cyber risks landscape L reassess-
ment
5. Discussion
The comprehensive understanding of future cyber attacks is producing nu-
merous multidimensional problems that are difficult to be adequately tackled in
84
ESGI’120 Future Cyber Attacks Modelling & Forecasting
todays’ fast evolving digital world. A suitable support in this sense is proposed
in the present study, combining data from both experts and literature. Further
uncertainty coping is achieved with probabilistic modelling that is practically im-
plemented in an ad-hoc designed and prototyped risk modelling and assessment
research environment.
The cyber landscape risk results generalization could be summarized up to
year 2021 as follows: (i) attack vectors expecting priorities of: “Privacy & Social
Engineering”, “Data Breaching & Espionage”, “Malware & Targeted Attacks”
with moderate ones for “Compromised by Design Equipment”; (ii) intrusions
critical points for (i), encompassing: “Users”, “Open-”, “Mobile-” & “Smart-”
Web 3.0 services, noting also “Third-Party Players” key role.
What however stays uncertain is the future cyber risks landscape validation
and verification in advance, being generally an arguable problematic area. A
useful added value in this sense could be found in the more active role of human-
computer hybrid simulations, combined with detailed cyber attacks mathematical
modelling.
Acknowledgements
The study is partially supported by SP15-FMIIT-007 project, Faculty of Math-
ematics & Informatics, Plovdiv University ‘Paisii Hilendarski’.
References
[1] Seven Ways to Apply the Cyber Kill Chain with a Threat Intelligence Plat-
form, Lockheed Martin, 2015, Available at: [Link]
[3] Minchev, Z., Dukov, G., Ivanova, T., Mihaylov, K. Boyadzhiev, D., Mateev,
P., Bojkova, M., Daskalova, N. Cyber Intelligence Decision Support in the
Era of Big Data, In ESGI 113 Problems & Final Reports Book, Chapter 6,
FASTUMPRINT, pp. 85–92, 2015.
[4] Minchev, Z. & Dukov, G. Emerging Hybrid Threats Modelling & Explo-
ration in the New Mixed Cyber-Physical Reality, BISEC 2016, Belgrade
Metropolitan University, October 15, pp. 13–17, 2016.
85
Future Cyber Attacks Modelling & Forecasting ESGI’120
[6] Ng, K. W., Tian, G.-L., Tang, M.-L. Dirichlet and Related Distributions:
Theory, Methods and Applications, John Wiley & Sons, 2011.
[9] Built Environment 2050. A Report on Our Digital Future, BIM 2050 Team,
2014, Available at: [Link]
86
Post-Processing for Beam Elements:
Calculating the Second Order Work
and Strain Energy
Stanislav Stoykov, Dimitar Fidanov, Maria Datcheva, Stefka Dimova
3. φ: nodal rotation;
The objectives, posed by the company Gruner, were to show a way to calculate
the strain energy of one beam element and the second order work as a post-
processing after finishing the FE-simulation. This must be done by using only
the nodal variables cited above.
88
ESGI’120 Post-Processing for Beam Elements
v (x, y, t) = v0 (x, t) ,
89
Post-Processing for Beam Elements ESGI’120
α e ∂g ∂f T e
D = De − D D ,
d ∂σ ∂σ
where α = 0 in the elastic case, α = 1 in the plastic case, f is the yield function,
g is a plastic potential function and
∂f T e ∂g
d= D .
∂σ ∂σ
For more guidance see again [8], pp. 3–1, 3–2.
4. Strain energy
The strain energy of the structure is computed by the stresses and the strains:
1 1
Z Z
U= εT σdV = εT DεdV ,
2 V 2 V
1
Z
U= (εx σx + γxy τxy ) dV =
2 V
90
ESGI’120 Post-Processing for Beam Elements
Z
1 ∂u0 ∂φz ∂u0 ∂φz ∂v0 ∂v0
= +y E +y + + φz λG + φz dV =
2 V ∂x ∂x ∂x ∂x ∂x ∂x
∂u0 2 ∂φz 2
Z Z
1 1
= EA dL + EIz dL+
2 L ∂x 2 L ∂x
!
∂v0 2
1 ∂v0
Z
+ λGA +2 φz + φz 2 dL,
2 L ∂x ∂x
where L denotes the length of the beam, A is the cross sectional area, Iz is the
second moment of area: Z
Iz = y 2 dΩ.
Ω
It
R is assumed that the cross section of the beam is symmetric, thus the integral
Ω ydΩ = 0 and it is not included in the expression of the strain energy. For
the cases of beams with non-symmetrical cross sections, this integral should be
included in the expression.
5. FEM discretization
Again for simplicity we will show the FE technic by using 3-node quadratic
finite elements. Each finite element, given by nodes x1 , x2 , x3 , is transformed
into the standard element in local coordinate system in the interval [−1; 1]. The
shape functions are given by:
1
N1 = − (1 − ξ) ξ,
2
N2 = (1 + ξ) (1 − ξ) ,
1
N3 = (1 + ξ) ξ,
2
where ξ is the local coordinate. The transformations from local to global coordi-
nate systems and vice versa are expressed by:
l (x1 + x3 )
x= ξ+ ,
2 2
2x (x1 + x3 )
ξ= − ,
l l
l = x3 − x1 is the length of the finite element.
91
Post-Processing for Beam Elements ESGI’120
The displacement components on the middle line are expressed by their values
on the nodal points and the shape functions:
where, for example, u10 , u20 , u30 are the values of the longitudinal displacement in
the nodal points of the finite element. The derivatives of the displacements can
be expressed on the following way:
∂u0 ∂N1 ∂N2 ∂N3
= u10 + u20 + u30 .
∂ξ ∂ξ ∂ξ ∂ξ
Taking into account the expression for the strain energy derived in the previous
section, and using the finite element discretization, the strain energy can be
computed by the values of the displacement components on the nodal points:
Z 1 2 !
∂φz 2 2
Z 1 Z 1 2
1X ∂u0 2 ∂v0 2
U= EA dξ + EIz dξ + λGA dξ
2 e −1 ∂ξ l −1 ∂ξ l −1 ∂ξ l
Z 1 Z 1
1X ∂v0 2l
+ 2λGA φz dξ + λGA φz dξ ,
2 e −1 ∂ξ −1 2
where summation over all finite elements denoted by e is implemented.
The integration in the local coordinate system can be performed by Gauss
quadrature formula. Three Gauss integration points are enough to compute the
integrals: Z 1
f (ξ)dξ = c1 f (ξ1 ) + c2 f (ξ2 ) + c3 f (ξ3 )
−1
√ √
with nodes ξ = (− 0.6, 0, + 0.6) and coefficients c = (5/9, 8/9, 5/9).
In the computation of the strain energy one needs to know the derivatives of the
displacement components. One way to obtain them is by using the derivatives of
the shape functions and the values of the displacement components on the nodal
points, as shown above. The other way is to use the normal and shear forces and
the bending moment provided as output from Plaxis.
∂v0
Q = λAG +φz ,
∂x
92
ESGI’120 Post-Processing for Beam Elements
∂v0
i.e. from here the value of ∂x is known.
∂φz
M = EI ,
∂x
∂φz
i.e. the value of is known.
∂x
∂u0 ∂φz
N = Aσx = EA +y ,
∂x ∂x
∂u0
i.e. from here the value of is known.
∂x
Remark. The FE technic when using 5-node finite elements is the same. The
form functions are those on p. 28 of the PLAXIS 2D 2016 Scientific manual [6].
References
[1] PLAXIS [Link]
[2] Z. Bittnar, J. Kruis. Modified beam element based on Mindlins theory. S. N.
Atluri et al. (eds) Computtional Mechanics’95. Springer Verlag 1995, p. 1656.
[3] Bending of beams – Mindlin theory. [Link]
teaching/mk10/lectures/[Link].
93
Mathematical Model of Residential Storage
Water-heating System
Masoud Ghaderi Zefreh, Mariia Dvoriashyna, Mihail Galabov, Lyudmil Yovkov,
Konstantinos Liolios, Stanislav Darachev
Abstract
The present document reports the work carried on during ESGI 120 in Sofia.
The considered problem is Mathematical Model of Residential Storage Water-
heating System. We strove to model the device from Melisa Climate Ltd which
controls the water heater system in the house. We used two approaches to model
the problem that complement each other. The first one represents the dynamics
inside the heater and the second model considers the control loop run by the
device without assuming any delay caused by first block. Although an integrated
model is not developed, the ingredients for such one are presented.
Key words: convection/diffusion heat transfer, Boussinesq approximation,
feed-back control-loop
1. Introduction
The low-cost commonly available water heater is inherently a lossy device and
this means that a high percentage of the energy consumed for heating water ends
up being lost as heat to the surroundings. Informal measurements and practice
show that when a family of four people switches on and off the water heater just
when required, savings of up to 80% are recorded.
Our goal is to develop a model of the water heater to perform energy saving
calculations and help the customer to operate their water heaters in the most
energy-efficient way.
1.2. Overview
The problem was observed from
two different but complementary per- Figure 1. Schematic view of the heater
spectives. First, a closed-flow problem system
was considered in order to understand
the dynamics inside the heater, Sec-
tion 2. The process is simplified to a 1-dimensional problem along the height
of the water tank and spacial temperature distribution is investigated. Then, in
Section 3, we analyzed the temperature dynamics during water consumption, as-
suming uniform temperature distribution inside the heater. The realistic solution
would be a combination of both models, since the time required to reach uniform
temperature in the second model should be estimated from the first one. More-
over, the assumption of uniform temperature inside the tank does not appear to
be imposing any stringent premises and the results in Section 3 seem to comply
with those provided by the company.
95
Mathematical Model of Residential Storage Water-heating System ESGI’120
(1) ρ − ρ0 = −β(T − T0 ),
∂v 1
(2a) + v∇ · v = − ∇P + ν∇2 v − gβ(T − T0 ),
∂t ρ0
(2b) ∇ · v = 0,
∂T
(2c) + v∇T = κ∇2 T,
∂t
where v is fluid velocity, P is pressure, ν is fluid viscosity and κ is thermal
diffusivity. The constants used in Eq. (2) and in other equations are given in
Table 1.
Table 1. Values of the physical parameters
Constant Value
ρ 988 kg/m3
cp 4185 J/(kg. ◦ C)
λ 0.59 W/(m. ◦ C)
V 225 m3
I {0; 13.5}
κ 1.4269 e-07 W.m2 /J
L 1m
Tf 500 s
V0 0.1963 m3
cm {0; 0.0211}
TA 25 ◦ C
TH 70 ◦ C
96
ESGI’120 Mathematical Model of Residential Storage Water-heating System
Eq. (2) are too complex to attack directly. We assume that the domain is
1-dimensional with spacial dimension x along the vertical axis of the tank. x = 0
corresponds to the bottom of the tank and x = L to the top part. We assume in
Section 2.1 that the heat is supplied at x = 0. Therefore, the hot bottom plate
is heating up the cold water.
To avoid solving Navier–Stokes equations in Eq. (2) for the fluid motion inside
the water tank we use an estimation for the spatial velocity distribution of the
fluid. Since, we are looking at a closed-flow system, the velocity on top and
bottom of the heater is zero and we assume parabolic flow profile:
4x(L − x)
(3) v(x) = vmax ,
L2
√
where we estimated vmax = 2gLβ∆T by equalizing the pressure difference ∆p =
ρβ∆T gL to the dynamic head ρv 2 /2 in absence of viscous forces in the flow.
Note that this velocity choice does not satisfy the continuity equation in Eq.
(2). This is a drawback of our model, however, we reason that this velocity is more
realistic than simply a constant one (which satisfies the continuity equation).
(4) T = TH
x=0
∂T
(5) = 0,
∂x
x=L
where TH = 70 ◦ C is the temperature of the hot water at the bottom. The initial
condition is chosen to agree with boundary conditions at t = 0 and has a shape
of piecewise linear function:
97
Mathematical Model of Residential Storage Water-heating System ESGI’120
We used finite difference approximation for the derivatives and thus to solve
Eq. (2c). A fully implicit scheme with 100 grid points in space and 5000 grid
points in time was implemented.
Fig. 2 illustrates the temperature variation for a few points inside the tank
and Fig. 3 shows all the temperature waves at all times. The average speed of
the temperature wave is much smaller than the maximum velocity. This suggests
that for an inflow of water to heat up, there is a delay time one has to take into
consideration. The delay temperature depends on the temperature of the inflow
water.
98
ESGI’120 Mathematical Model of Residential Storage Water-heating System
99
Mathematical Model of Residential Storage Water-heating System ESGI’120
described as
X
(8) F (t) = fi χ(t; ti , ti+1 ),
i
where
(
1 t ∈ [ti , ti+1 ]
(9) χ(t; ti , ti+1 ) = ,
0 otherwise
dy(t)
(11) + ai y(t) = bi , ti ≤ t < ti+1
dt
which has analytical solution in the form
bi
(12) y(t) = ξi e−ai t + , ti ≤ t < ti+1 ,
ai
100
ESGI’120 Mathematical Model of Residential Storage Water-heating System
where ξi depends on the solution at ti from the previous time step (i.e, ti ≤ t <
ti+1 ).
As an example we assumed a consumption schedule for a person in a day time
as in Fig. 5. We took the sensitivity of the thermostat to be 3 ◦ C. Fig. 6 illustrates
the history of the electric power and the temperature profile for the outlet flow
from t = 30 min onwards.
Finally, we need to take into account for the heat loss from the pipes that
occurs between the heater and the sensors. According to problem description,
the temperature that is measured by the sensor is on the pipe. Therefore, there
is a convection heat transfer from the fluid inside the pipe to the inner wall of the
pipe which is followed by a conduction heat transfer from there to the outside
surface of the pipe. Finally, the outer surface is cooled down by Newton cooling
law through the cold surrounding air. The heat balance for the two processes are
expressed as
k
(13) hwater Ainner (Twater − T1 ) = (T1 − T2 ),
d
k
(14) hair Aouter (T2 − Tair ) = (T1 − T2 ),
d
where d is the thickness of the tube and T1 and T2 are the temperatures of the
inner and outer surface of the pipe, respectively. Using the proper parameters for
hwater and hair and properties of typical pipes used in houses (e.g. thickness=2
mm, diameter=1 inch) we found a decrease of maximum 3 ◦ C. An improved model
would be to plug Eqs (13) and (14) into Eq. (10) so that the heat loss plays its
role in the dynamics of the tank.
4. Conclusions
During the week of ESGI 120 we developed and solved the model for temper-
ature dynamics the residential electrical water heater. Two proposed approaches
101
Mathematical Model of Residential Storage Water-heating System ESGI’120
Figure 6. Hot water usage, power and temperature history for toy problem from Fig. 5
were covered. First, we constructed a 1-D spacial model of the temperature dis-
tribution inside the water tank with the heater located at the bottom of it. The
1-D approximation allowed us to avoid heavy numerical simulations, however,
it has couple of limitations such as the location of the heater is strictly at the
bottom of the tank and imposed fluid velocity that does not satisfy the continu-
ity equation. The later limitation can be eliminated if one considers 2-D model.
The results and parameter estimation suggest domination of the convective effect
with respect to diffusion, and therefore, suitable choice of the velocity profile is
crucial for the model.
The second proposed model described the temperature dynamics in the tank.
This model fits better to describe the experimental data, however, also has its
limitations, such as an assumption of uniform temperature inside the tank which
results into neglecting the time which is required for the water on the top of the
tank to heat up.
Both models can be integrated into a single complete model, and it is the
proposed step for the further research.
102
ESGI’120 Mathematical Model of Residential Storage Water-heating System
Acknowledgements
We would like to thank all the organizers who contributed for this event and
gave us the opportunity to be part of ESGI120 in Sofia. We are very grateful
to problem presenter, Mr. Kristiyan Boyanov, for his support during the study
group.
Last but not least, we would like to express our gratitude to Dr. Wil Schilders
from Eindhoven University for his valuable comments that guided us through the
problem.
References
[1] H. A. Suthar, J. J. Gadit, Modelling and Analysis of the Simple Water Heater
System, International Journal of Electrical and Computer Engineering 1 (1),
2011, 49–52.
[2] K. I. Elamari, Using Electric Water Heaters (EWHS) For Power Balanc-
ing and Frequency Control in PV-Diesel Hybrid Mini-Grids, [Link]. Thesis,
Concordia University, 2011.
[3] J. Vieira, A. Mota, Passing From a Gas to an Electric Water Heater Sys-
tem: Adaptable PID Versus Smith Predictive Control, Frontiers of Model
Predictive Control (Intech open), 2012.
[5] Kundu, P., and I. Cohen. “Fluid Mechanics”, 4th Edition, Academic Press,
2008.
103