
.jpg?auto=compress,webp&upscale=true&width=610&height=488&name=train%20driving%20in%20city%20(1).jpg)
In Part 1. The Scientific Method, we explored the scientific method's application to solving business challenges. In Part 2, we dive into a real-world problem and demonstrate how the scientific method is employed at ACA to revolutionize train arrival detection for a client.
In Part 1. The Scientific Method, we explored the scientific method's application to solving business challenges. In Part 2, we dive into a real-world problem and demonstrate how the scientific method is employed at ACA to revolutionize train arrival detection for a client.
The Challenge: Detecting Train Arrival with Precision
The journey began with a client's question: "Can we accurately detect train arrivals and departures at a platform within a few seconds?" To address this, we applied the scientific method's iterative approach, encompassing five key steps:
- Identify and analyze the problem
- Form a hypothesis
- Conduct experiments to test the hypothesis
- Analyze data
- Conclude on the results
Solving a question like the above usually takes a few iterations to come to a fully satisfying result.
Iteration 1: Where do we even start?
Step 1: Identify and Analyze the Problem
The research question is the following: "Is it possible to detect the arrival and departure of a train at a platform with the time resolution of a few seconds using a smartphone?" In the first step it is important to analyze the problem: understanding the properties of arrival and departure. Taking into account the project limitations, these properties can be measured using the GPS functionality in a smartphone. Furthermore, the velocity is accurately available in the received data as it is measured using the Doppler shift of the carrier frequencies.
In this case, we could rely on established knowledge and assumptions, providing a solid starting point for problem-solving. If no known truths exist, you should conduct preliminary investigations, in this case we had earlier work to rely on.
Step 2: Form a Hypothesis
Our hypothesis: “When we collect the position and velocity with aGPS, we will be able to reliably determine the arrival and departure at a platform based on the position and velocity characteristics, and with a good time resolution.”
The hypothesis is measurable, which is important to setup an experiment where labeled data points can be compared to the predicted data.
Step 3: Conduct Experiments to test the hypothesis
In step 3, we set up a proof of concept focusing on essential data and the proposed solution to avoid unnecessary details before proving the hypothesis. We developed an app storing aGPS info and velocity labeled for driving or standing still. Knowing aGPS limitations, we applied filters using accelerometer data, train constraints, and predicted routes, significantly improving location accuracy. This resulted in a significant improvement of the location data.
Step 4: Analyze Data
The results of the experiments:
- Successful detection of arrival and departure at a platform
- Excellent system stability
- Unreliable velocity due to inconsistent availability based on location data origin
- Insufficient time resolution, resulting in unpredictable location output.
Step 5: Conclude on the Results
Despite good initial results, the proposed solution didn't meet the essential time resolution requirement. Constructing a system with a consistent output rate becomes unfeasible while driving within a massive Faraday cage capable of blocking signals.
Iteration 2: Back to the drawing board
Step 1: Identify and Analyze the Problem
The first iteration didn't meet expectations, but that didn't discourage us. We realized the oversight in time resolution. Furthermore, during that time at ACA we successfully applied new techniques on a similar problem.
The accelerometer provided reliable data, and by combining it with the gyroscope and magnetometer, we obtained directional acceleration. Anticipating distinct acceleration patterns for different transportation modes and states, such as standstill and driving, we decided to leverage a Naïve Bayes algorithm. This supervised learning algorithm creates a probabilistic classifier, predicting standstill and driving based on measured properties.
Step 2: Form a Hypothesis
A new hypothesis emerged: "Naïve Bayes classifier can be used to differentiate between walking acceleration pattern and its super position with a train in motion acceleration pattern."
Step 3: Conduct Experiments to test the hypothesis
An application was created to collect data that was labeled with the correct state. Then, we trained the Naïve Base classifier using various data features, such as maximum, minimum, mean, norm, standard deviation, distance to the platform, and minimum required velocity.
Step 4: Analyze Data
Multiple classifiers were trained, tested, and assessed using confusion matrices. The results showed driving was correctly identified 94% of the time, but standstill was only identified accurately 48% of the time, with the classifier mistakenly labeling standstill as driving in 52% of cases.

Step 5: Conclude on the Results
The Naïve Bayes classifiers lacked the needed accuracy for our problem. The features had significant overlap, preventing differentiation between standstill and driving. Additionally, the classifiers couldn't capture the transient nature of arrival and departure accurately, prompting further exploration for a solution.
Iteration 3: It is all about the change
Step 1: Identify and Analyze the Problem
The previous experiments revealed that velocity and position lacked sufficient time resolution, and probabilistic models struggled with the transient nature of arrival and departure. Recognizing the importance of the transient aspect, it's evident that properties like velocity or position aren't crucial; instead, acceleration is key. Arrival can be defined as a deceleration followed by a period of no acceleration, while departure is acceleration preceded by a period of no acceleration.
Step 2: Form a Hypothesis
A new hypothesis was formulated: “It is possible to use the transient nature of arrival and departure at a platform to detect the arrival and departure with a good time resolution and good accuracy.”
Step 3: Conduct Experiments to test the hypothesis
To focus on using accelerometer data for arrival and departure detection, we utilized data from the previous iteration, entering a new research domain aiming to build a signal analysis algorithm for classification.
In the following steps, multiple graphs are added. The red background indicates that the train was at the platform, green indicates that it was in motion.
- Look at the data:
Take a look at the graph of the Y-channel of the accelerometer. We chose not to project the acceleration onto the real-world axis initially to keep it in its raw form, minimizing the required computing power.
There wasn’t much to tell our program with this data, it looks mostly random.
- Perform data manipulations to improve clarity:
Velocity remains constant during driving and standstill, but arrival and departure are characterized by changes in acceleration. Arrival involves deceleration followed by no acceleration, while departure involves acceleration after a period of no acceleration. Accumulating acceleration over time reveals trends similar to velocity but with notable changes during arrival and departure, providing insights for program interpretation, though further signal processing is necessary.
- Calculate the Gradient:
To avoid the original data being retrieved by taking the gradient from the cumulative curve, additional data manipulation is performed. The cumulative curve undergoes smoothening through a one-second moving average. On a macroscopic level, the curve retains its appearance, but noise in the data is reduced. The resulting graph, incorporating all three channels for completeness, is obtained by taking the gradient.
- Clean Up the Data:
The current data remains noisy and challenging for program interpretation. In standstill regions (red area), minimal acceleration is observed, while the driving area exhibits significant fluctuations. This challenges the notion of constant velocity during motion, attributed to train vibrations and acceleration/deceleration. Contrary to constant velocity beliefs, this disparity between states enhances the likelihood of finding a viable solution, addressing both states rather than just the transition between standstill and driving. To enhance data quality, a high-pass filter is applied, removing drift (green and blue curve not centered around 0) and electronic noise (constant frequency in the green curve). The results are as follows:
- Ignore Sign of Acceleration:
To disregard the acceleration's directionality, we eliminate signs and channels are combined by taking the absolute value and summing the three channels. To mitigate remaining data noise, a cut-off is applied, ignoring insignificant acceleration.
Using this processed data, a straightforward algorithm is devised for determining arrival and departure. As previously mentioned, arrival is characterized by deceleration followed by no acceleration, while departure is acceleration after a period of none. This distinction is evident in the graph, where +1 indicates departure, and -1 indicates arrival at the platform.
Step 4: Analyze Data
Data analysis occurred primarily during the experiment. Subsequently, our algorithm was tested with unused data, revealing some false positives but no false negatives. This facilitates data optimization. While data cannot be generated from nothing, combining measurements with aGPS data helps filter out false positives.
Step 5: Conclude on the Results
The algorithm that was developed in this iteration of the scientific method, proved our last hypothesis.
“It is possible to use the transient nature of arrival and departure at a platform to detect the arrival and departure with a good time resolution and good accuracy.”
Conclusion: A Journey to Precision
In this blog post, we detailed the complete process to solving a complex problem with precision. Through iterations, learning from failures, and discarding assumed knowledge, we crafted a reliable solution.
The algorithm, combining known mathematics with aGPS data, can accurately detect train arrival and departure at a platform using only a smartphone, achieving a time resolution of less than 1 second.
Do you want to know more about our proven IT problem-solving method?
Or looking for an experienced app development partner?
What others have also read


Liferay DXP has become a widely adopted portal platform for building and managing advanced digital experiences over recent years. Organizations use it for intranets, customer portals, self-service platforms, and more. While Liferay DXP is known for its user-friendliness, its default search functionality can be further optimized to meet modern user expectations. To address this, ACA developed an advanced solution that significantly enhances Liferay’s standard search capabilities. Learn all about it in this blog. Searching in Liferay: not always efficient Traditionally, organizational searches relied on individual keywords . For example, intranet users would search terms like "leave" or "reimbursement" to find the information they needed. This often resulted in an overload of results and documents , leaving users to sift through them manually to find relevant information—a time-consuming and inefficient process that hampers the user experience. The way users search had changed The rise of AI tools like ChatGPT has transformed how people search for information. This is also visible in online search engines like Google, where users increasingly phrase their queries as complete questions. For example: “How do I apply for leave?” or “What travel reimbursement am I entitled to?” To meet these evolving search needs, search functionality must not only be fast but also capable of understanding natural language. Unfortunately, Liferay’s standard search falls short in this area. ACA develops advanced AI-powered search for Liferay To accommodate today’s search behavior, ACA has created an advanced solution for Liferay DXP 7.4 installations: Liferay AI Search . Leveraging the GPT-4o language model , we’ve succeeded in significantly improving Liferay’s standard search capabilities. GPT-4o is a state-of-the-art language model trained on an extensive dataset of textual information. By integrating GPT-4o into our solution, we’ve customized search algorithms to handle more complex queries , including natural language questions. How does Liferay AI Search work? Closed dataset The AI model only accesses data from within the closed Liferay environment. This ensures that only relevant documents— such as those from the Library and Media Library—are accessible to the model. Administrators controls Administrators can decide which content is included in the GPT-4o dataset, allowing them to further optimize the accuracy and relevance of search results. Depending on the user’s profile, the answers and search results are tailored to the information they are authorized to access. Direct answers Thanks to GPT-4o integration, the search functionality provides not only traditional results but also direct answers to user queries. This eliminates the need for users to dig through search results to find the specific information they need. The comparison below illustrates the difference between search results from Liferay DXP’s standard search and the enhanced results from ACA’s Liferay AI Search. Want to see Liferay AI Search in action? Check out the demo below or via this link! Be nefits of Liferay AI Search Whether you use Liferay DXP for your customer platform or intranet, Liferay AI Search offers numerous advantages for your organization: Increased user satisfaction: Users can quickly find precise answers to their queries. Improved productivity: Less time is spent searching for information. Enhanced knowledge sharing: Important information is easier to locate and share. Conclusion With Liferay AI Search, ACA elevates Liferay DXP’s search functionality to meet modern user expectations. By integrating GPT-4o into Liferay DXP 7.4, this solution delivers not only traditional search results but also direct, relevant answers to complex, natural language queries. This leads to a faster, more user-friendly, and efficient search experience that significantly boosts both productivity and user satisfaction. Ready to optimize your Liferay platform search functionality Contact us today!
Read more

Staying current with the latest trends and best practices is crucial in the rapidly evolving world of software development. Innovative approaches like EventSourcing and CQRS can enable developers to build flexible, scalable, and secure systems. At Domain-Driven Design (DDD) Europe 2022 , Paolo Banfi delivered an enlightening talk on these two techniques. What is EventSourcing? EventSourcing is an innovative approach to data storage that prioritises the historical context of an object. Rather than just capturing the present state of an object, EventSourcing stores all the events that led to that state. Creating a well-designed event model is critical when implementing EventSourcing. The event model defines the events that will be stored and how they will be structured. Careful planning of the event model is crucial because it affects the ease of data analysis. Modifying the event model after implementation can be tough, so it's important to get it right from the beginning. What is CQRS CQRS (Command Query Responsibility Segregation) is a technique that separates read and write operations in a system to improve efficiency and understandability. In a traditional architecture, an application typically interacts with a database using a single interface. However, CQRS separates the read and write operations, each of which is handled by different components. Combining EventSourcing and CQRS One of the advantages of combining EventSourcing and CQRS is that it facilitates change tracking and data auditing. By keeping track of all the events that led to a particular state, it's easier to track changes over time. This can be particularly useful for applications that require auditing or regulation. Moreover, separating read and write operations in this way provides several benefits. Firstly, it optimises the system by reducing contention and improving scalability. Secondly, it simplifies the system by isolating the concerns of each side. Finally, it enhances the security of sensitive data by limiting access to the write side of the system. Another significant advantage of implementing CQRS is the elimination of the need to traverse the entire event stream to determine the current state. By separating read and write operations, the read side of the system can maintain dedicated models optimised for querying and retrieving specific data views. As a result, when querying the system for the latest state, there is no longer a requirement to traverse the entire event stream. Instead, the optimised read models can efficiently provide the necessary data, leading to improved performance and reduced latency. When to use EventSourcind and CQRS It's important to note that EventSourcing and CQRS may not be suitable for every project. Implementing EventSourcing and CQRS can require more work upfront compared to traditional approaches. Developers need to invest time in understanding and implementing these approaches effectively. However, for systems that demand high scalability, flexibility or security, EventSourcing and CQRS can provide an excellent solution. Deciding whether to use CQRS or EventSourcing for your application depends on various factors, such as the complexity of your domain model, the scalability requirements, and the need for a comprehensive audit trail of system events. Developers must evaluate the specific needs of their project before deciding whether to use these approaches. CQRS is particularly useful for applications with complex domain models that require different data views for different use cases. By separating the read and write operations into distinct models, you can optimise the read operations for performance and scalability, while still maintaining a single source of truth for the data. Event Sourcing is ideal when you need to maintain a complete and accurate record of all changes to your system over time. By capturing every event as it occurs and storing it in an append-only log, you can create an immutable audit trail that can be used for debugging, compliance, and other purposes. Conclusion The combination of EventSourcing and CQRS can provide developers with significant benefits, such as increased flexibility, scalability and security. They offer a fresh approach to software development that can help developers create applications that are more in line with the needs of modern organisations. If you're interested in learning more about EventSourcing and CQRS, there are plenty of excellent resources available online. Conferences and talks like DDD Europe are also excellent opportunities to stay up-to-date on the latest trends and best practices in software development. Make sure not to miss out on these opportunities if you want to stay ahead of the game! The next edition of Domain-Driven Design Europe will take place in Amsterdam from the 5th to the 9th of June 2023. Did you know that ACA Group is one of the proud sponsors of DDD Europe? {% module_block module "widget_bc90125a-7f60-4a63-bddb-c60cc6f4ee41" %}{% module_attribute "buttons" is_json="true" %}{% raw %}[{"appearance":{"link_color":"light","primary_color":"primary","secondary_color":"primary","tertiary_color":"light","tertiary_icon_accent_color":"dark","tertiary_text_color":"dark","variant":"primary"},"content":{"arrow":"right","icon":{"alt":null,"height":null,"loading":"disabled","size_type":null,"src":"","width":null},"tertiary_icon":{"alt":null,"height":null,"loading":"disabled","size_type":null,"src":"","width":null},"text":"More about ACA Group"},"target":{"link":{"no_follow":false,"open_in_new_tab":false,"rel":"","sponsored":false,"url":{"content_id":null,"href":"https://acagroup.be/en/aca-as-a-company/","href_with_scheme":"https://acagroup.be/en/aca-as-a-company/","type":"EXTERNAL"},"user_generated_content":false}},"type":"normal"}]{% endraw %}{% end_module_attribute %}{% module_attribute "child_css" is_json="true" %}{% raw %}{}{% endraw %}{% end_module_attribute %}{% module_attribute "css" is_json="true" %}{% raw %}{}{% endraw %}{% end_module_attribute %}{% module_attribute "definition_id" is_json="true" %}{% raw %}null{% endraw %}{% end_module_attribute %}{% module_attribute "field_types" is_json="true" %}{% raw %}{"buttons":"group","styles":"group"}{% endraw %}{% end_module_attribute %}{% module_attribute "isJsModule" is_json="true" %}{% raw %}true{% endraw %}{% end_module_attribute %}{% module_attribute "label" is_json="true" %}{% raw %}null{% endraw %}{% end_module_attribute %}{% module_attribute "module_id" is_json="true" %}{% raw %}201493994716{% endraw %}{% end_module_attribute %}{% module_attribute "path" is_json="true" %}{% raw %}"@projects/aca-group-project/aca-group-app/components/modules/ButtonGroup"{% endraw %}{% end_module_attribute %}{% module_attribute "schema_version" is_json="true" %}{% raw %}2{% endraw %}{% end_module_attribute %}{% module_attribute "smart_objects" is_json="true" %}{% raw %}null{% endraw %}{% end_module_attribute %}{% module_attribute "smart_type" is_json="true" %}{% raw %}"NOT_SMART"{% endraw %}{% end_module_attribute %}{% module_attribute "tag" is_json="true" %}{% raw %}"module"{% endraw %}{% end_module_attribute %}{% module_attribute "type" is_json="true" %}{% raw %}"module"{% endraw %}{% end_module_attribute %}{% module_attribute "wrap_field_tag" is_json="true" %}{% raw %}"div"{% endraw %}{% end_module_attribute %}{% end_module_block %}
Read more

Y ou can’t design or develop something for all 7.9 billion people on the planet. So when we start a project, we decide on a target audience to narrow it down. From there we build our features and designs in a way that seems fitting for that audience. However, what we can’t narrow down on are the accessibility features. Everybody needs to have the possibility to use or experience your said creation. Some devices have built-in features like Google Talkback , where your device can tell you what’s happening on screen and even use that information with a digital braille reader. Or sometimes we make sure our platforms are accessible to use, such as our website, which by the way has a Google Lighthouse accessibility score of 98! But why stop there? Every piece of content should be accessible for everyone. This also counts for PDF files. Get started with these 3 tips we’ve gathered using a MediMarket Case Study : Do an accessibility check with Acrobat Pro First things first: do an accessibility check with Adobe Acrobat Pro. This check immediately indicates in a clear list which issues you need to face. Some of these issues can be solved directly in Acrobat Pro, and others require you to go back to your source file or check manually. You can gather a bit more knowledge by clicking the Autotag Document option. This will read the PDF and give you another accessibility summary about missing alt text, but more about this later. Realize the importance of the reading order Ever heard a screen reader freak out because it doesn’t understand your reading order or structure in the PDF file? Well, imagine someone talking way too fast, without stopping and without any clue what they want to say. Sounds chaotic, right? Now think about the users that really depend on these types of digital aids. Your PDF is basically useless when this happens. So be certain you have a structured document with the right identity headings, paragraphs and sections when creating the PDF. Want to add this to an existing PDF? With Acrobat Pro, you can read the reading order later thanks to their accessibility options. In this screenshot you can clearly see what the screen reader will read first, second, third and so on. Did you know Alt Text is also possible in PDF files? Is this the surprise of the day, or did you never bother to add an alternative text in your documents? Well, start by adding alt text on images or interactive fields. A screen reader can’t read your JPEG files and you need to explain what is shown to them. Don’t overdo it though, your user doesn’t really need to know you added that cute cat photo as filler. Don’t do this just with images. Audio and video elements are also in need of alt text. This isn’t only necessary for users with bad eyesight or hearing, but also for users with bad internet connection who only can download the text of your PDF. There is a lot more to this, but these 3 tips can certainly get you started! However, what I really wanted to achieve with this blogpost is that you start thinking about making all your content more accessible. Do you want more information about accessibility, for example in mobile applications? Go to our services and see for yourself what we can help you with!
Read moreWant to dive deeper into this topic?
Get in touch with our experts today. They are happy to help!

Want to dive deeper into this topic?
Get in touch with our experts today. They are happy to help!

Want to dive deeper into this topic?
Get in touch with our experts today. They are happy to help!

Want to dive deeper into this topic?
Get in touch with our experts today. They are happy to help!


