Thursday, May 8, 2025

 This is a summary of the book titled “The Psychology of Leadership” written by Sebastien Page and published by Harriman House in 2025. The author is a business executive who brings his experience and aspects of sports psychology, positive psychology and personality psychology to discover and frame tenets of universal leadership that promotes high-end performance. These tenets include being aware of unintended consequences, organizing your work around your goals, and not obsessing over winning. This also implies developing a personal sense of success, assessing those beliefs, giving a sense of purpose to everyone and developing patience.

By borrowing ideas from different perspectives and disciplines besides his own experience, he rounds up his framework with the specific mental skills that are critical to high performance. For example, sports psychology doesn’t define success as winning but learning to develop mental resilience to keep going when you lose. The PERMA model which stands for “positive emotions, engagement, relationships, meaning and accomplishment” offers the advantage of setting realistic goals and preparing for unforeseen consequences. This is especially helpful to long-term roadmaps.

Developing an innate sense of success also differentiate success and happiness. Success must lead to happiness. Real, enduring happiness centers more on “ERMA” in the PERMA. Good relationships with your colleagues, a sense that your work is meaningful and a feeling of genuine accomplishment can lead to personal happiness. A good leader knows that this leads to increased productivity and motivation in the team. To promote engagement and flow, optimize “Return on Time Spent”. Start by reviewing the job’s activities for everyone, the time and effort involved and how it aligns with goals. A sense of meaning benefits everyone. The R and the M in the PERMA stand for relationships and meaning. Relationships is how people trust one another, and Meaning is what binds them. An articulated purpose should come through in goal setting. Although A stands for accomplishments, success should not be the only priority. Success does boost well-being but in isolation, it is just a heady rush or short-lived emotion. Similarly, mastery isn’t a one-off experience, it is a sustainable character trait. When assessing your own beliefs on success, start with how you and your team relate to the world. Re-evaluating trivial mission statements, refining core beliefs and writing them down help. Engineering taught us about dynamic feedback loops to narrow down the discrepancies between expectations and reality. Working backwards from the goal helps us do that.

Finally, most leadership, charters, roadmap, goals, relationships, success and motivation must be accommodating to unknown and unforeseen circumstances as they develop. So, developing strategic patience may not be comfortable but it is needed.


Wednesday, May 7, 2025

 The DFCS drone video sensing platform is intended to be one that facilitates writing video sensing applications for a variety of purposes. The platform strives to do one use case for a video sensing application very well with its proprietary model and RAG enhanced autonomous routing, but the same knowledge base, world catalog and vector search and image processing pipeline can also be used for other applications.

The analytics engine of the DFCS platform supports natural language queries but this could be customized. For example, “Contextual Embeddings” was popularized by Anthropic and Microsoft communities for text data and this is applicable to the DFCS world catalog. Given a document, they split it into chunks of text and prepend a chunk specific explanatory context generated by an LLM. There is no loss of information at chunk boundaries. Let us call this a ContextRetrieval class and it has methods implemented with langchain for Azure to load a pdf and parse using AzureAIDocumentIntelligenceLoader, then process it with a method that splits the document efficiently ensuring no loss of information at chunk boundaries, follow it with generating a context for each chunk using a ChatPromptTemplate by identifying the main topic in the chunk along with its relation to the broader context and including key figures, dates or percentages.

While the contextualized chunks can be used with an RAG for semantic similarity-based search aka dense retrievers, it can also be used with lexical search like Best Match 25 aka BM25 to find exact matches and specific terminology. So, the class has an additional method to supplement retrieval. When the document arrives in the pipeline, the dense and sparse retrievers quickly narrow down a search space to get relevant chunks. The ContextRetrieval class has methods to create bm25 index. Then for each of these relevant chunks, a large language model is used to generate an answer using a prompt. With the generated answers, the ContextRetrieval class performs a second stage processing called re-ranking by analyzing the deep semantic relationship between the query and the chunk, considering factors like factual alignment, answer coverage, and contextual relevance. This was demonstrated to have a better match than using chunks without contexts or the whole document as the baseline.

Since the world catalog is based on location, contextual embeddings leverage the indexes on location and the associated keypoint features so that the responses for the user query are more aligned.


Tuesday, May 6, 2025

 This is a summary of the book titled “The Perfect Swarm - The Science of Complexity in Everyday Life” written by Len Fischer and published by Basic Books in 2009. The author is a physicist who is writing about group behavior in a style that reflects humor and wit while drawing on incredible gamut of evidence from experiments, historical events, contemporary cases and real-life experiences. His coverage of group behavior might be exciting for professionals in all walks of life. He cites unbelievable examples such as self-organizing locust swarms and fish schools, progression from chaos to order without any guided intelligence, positive feedback and chain reactions throwing into a chaos while “negative feedback” stabilizing the group, swarm without leader or roadmap hitting the goal, and such others. He tells us a group uses one of three tactics to reach a consensus regardless of right or wrong: deciding by majority, debating till agreement, or using swarm intelligence. Almost always, a group of experts outperforms individual members in making decisions. When you face many options, look for patterns in information, but test them to make sure they are reliable and decide on a solution that surpasses your expectations.

The science of complexity studies the rules and processes of self-organization, allowing complex structures and relationships to emerge out of chaos without a central director or single intelligence. Swarm behavior becomes swarm intelligence when a group can solve a problem collectively in a way that individuals within the group cannot. Systems exhibit two types of dynamic patterns: cycles as in a family quarrel and adaptive systems as in cheering becoming a unison. Swarms have no leaders, but members can pass information to one another through observation and rules.

Crowds have emergent complex structures that arise from physical and social forces between individuals. Certain phenomena, such as positive feedback and chain reactions, can throw a swarm back into chaos. Positive feedback, such as between a microphone and an amplifier, can lead to a loud sound and cause a system to crash, while chain reactions, like locusts feeling happy to congregate can lead to swarms of up to 100 billion locusts and a human running in a neighborhood in Columbus, Ohio believing a tidal wave was coming, was joined by everyone in the neighborhood one by one.

Negative feedback balances destabilizing forces, as described by Adam Smith's "invisible hand" theory where prices stabilize after instability or disturbance.

In city streets, humans and bees follow 3 similar principles of swarming, avoiding collisions, aligning with their closest bees, and attracting each other. This behavior is similar to how humans lead crowds, even when they don't know the leader or target. Ant colonies use pheromones to find the shortest route to and from scarce resources, drawing more ants to follow the shortest trail. This phenomenon can be used to succeed in the market by imitating others.

People move like ants, establishing distinct pedestrian lanes and maintaining traffic flow at a certain population density. Traffic clogs can be managed by urban designers taking traffic flow into account, such as widening crowded areas or placing pillars strategically in buildings. In a panic, people follow the swarm about 60% of the time and search for alternative means of escape about 40% of the time. Planning emergency strategies in advance is crucial to avoid panics and ensure safety.

To make decisions in a group, individuals can either vote or generate an average opinion to guide the group. The method depends on the question being asked. For estimating questions, asking everyone to come up with a number on their own and then averaging the responses can be more accurate. For multiple-choice questions, voting and going with the majority can be more effective. Experts are most useful when dealing with problems at the intersection of knowledge and initiative. Groups often struggle to reach consensus due to the three choices: follow the will of the majority, debate the issue until they reach consensus, or use swarm intelligence. Groupthink is a dangerous phenomenon where members overvalue the group's ethics and insight. Swarm intelligence emerges when individuals spontaneously and voluntarily interact to solve problems, resembling stakeholders rather than shareholders. Swarms are more likely than other groups to share their power or even give it away.

Networks are sets of items and connections that emerge among people, often combining elements of both deliberate planning and randomness. They are not evenly distributed, with connections clustering according to a "power law," with a few nodes having more connections than most others. Understanding the hubs and shortcuts that link parts of a network is crucial in various fields, such as public health and marketing. To decipher the importance of information, one can use an approach from gold miners, pick up obvious gems, sift through the data until nuggets emerge, and look for patterns in the unsorted mass of data. Patterns can emerge naturally and spontaneously in all areas of life and using heuristics can help make quick decisions. These include recognition, fluency, weighing, taking the best, and “satisficing” or exceeding expectations.

Reference: previous summaries: https://1drv.ms/w/c/d609fb70e39b65c8/EV8_nILFMeBGqIyIpFQtSGAB8bX0HfvlKUXZ6IfYvgsxTA?e=BMT3LD


Monday, May 5, 2025

 Database calls are fast and the curation of objects lends itself to query operators but does not take advantage of the progressive and rolling sequence of objects detected frame-by-frame or its bookkeeping along with multiple UAV sequence tracking which is something messaging paradigm and event processors have solved successfully in several data and telemetry pipelines and from a traditional grounding that databases are queues. With the shift in paradigm from rows to events and similar SQL operators across both such as with Flink, the DFCS drone video sensing platform does not demand adherence to a database or messaging paradigm if the interface supports the following requirements: 1. standard query operator on objects detected with world co-ordinates attributes. 2. participation in retrieval augmentation along with a vector store and search and 3. support analytics stacks with programmability that can support custom drone sensing applications built independent of the UAV swarm sensing-analysis-routing architecture dedicated to the swarms’ flights. In addition, some criteria are suggested for messaging pipelines which include:

1. Noise filtering: This involves sifting through data to spotlight the essentials.

2. Long-Term data retention: this involves safeguarding valuable data for future use

3. Event-trimming: This customizes data for optimal analytics so that the raw data is not dictating eccentricities in the charts and graphs.

4. Data condensation: this translates voluminous MELT data into focused metrics and prevents archiving or cleaning up as messages are removed from the queue.

5. Operational Efficiency Boosting: This amplifies operating speed and reliability.

This article implements a sample for this alternative with emphasis on multiple stream processors


Sunday, May 4, 2025

 Agentic object detection 

import requests

def get_bounding_boxes(api_key, image_path, search_text):

    headers = {"Authorization": f"Bearer {api_key}"}

    with open(image_path, "rb") as image_file:

        files = {"file": image_file}

        data = {"prompt": search_text}

        response = requests.post(

            "https://api.landing.ai/v1/agentic-object-detection",

            headers=headers,

            files=files,

            data=data

        )

    if response.status_code == 200:

        detections = response.json().get("detections", [])

        return [detection["box"] for detection in detections] # Returns [x_min, y_min, x_max, y_max] boxes

    else:

        raise Exception(f"API Error: {response.text}")

# Usage example

api_key = "your_api_key_here"

boxes = get_bounding_boxes(api_key, "sample.jpg", "red shoes")

print(f"Found {len(boxes)} matching objects:")

for box in boxes:

    print(f"- Bounding box: {box}")


Saturday, May 3, 2025

 This is a summary of the book titled “Robot Ethics” written by Mark Coeckelbergh and published by MIT Press in 2022. The author is an academic and philosopher who surveys the robots and discusses the moral challenges to answer questions such as how much privacy to surrender, the ratio of human to robots, should robots be allowed to perform surgery, fight wars on our behalf and such others. All these questions are driven towards what kind of future we want for our children. Changes brought about by robots are desirable and they are expected to enter all walks of life. As home companions, they pose a dilemma to how much personal information to share. In medical practice, they pose a question about quality. As self-driving vehicles, they pose a challenge to ethical decision making. As they get closer to human capabilities, how should they be treated when they appear like humans. When military robots reduce cost and risks of warfare, are wars acceptable? Are their ethics human ethics?

Robots are changing the world in mundane ways, altering work, travel, and interaction. The ethical implications of their use are significant, as they can deepen economic disparities, harm vulnerable groups, and lead to the loss of human life and dignity. The ethical dilemmas surrounding robotics include who holds responsibility for the problematic effects, such as the user, manufacturer, programmer, marketer, or regulatory agency. As robots become more like humans, society will face challenges in understanding what makes us human. The modern industrial site involves more human-robot interaction, bringing new challenges and concerns about worker welfare. Safety, security, and privacy are important concerns, as robots can carry heavy payloads and move in unpredictable ways. The new industrial revolution involves automation of repetitive mechanical tasks and complex mental work, with jobs at risk of automation in customer service and administrative assistance.

Robots may replace jobs in certain professions, but they may also lead to high-pressure and low-meaning occupations. Humans can mitigate these effects through planning and forward-looking policies. Some jobs, such as care work, teaching, and artistic endeavors, should remain in human hands, even if automation technology exists. Education is essential to prepare the workforce of the future, and it may be time to consider restructuring the socioeconomic framework through measures like universal basic income.

Robotic home companions and personal assistants present new issues regarding privacy and deception. Without legal protections, a surveillance state is likely. Robots designed to resemble people or speak with human voice patterns may perpetuate problematic stereotypes. Using robots for companionship and care raises concerns about deception and dignity, as the person being cared for may not understand the companion's non-human capabilities.

Sex robots illustrate the flip side of deception, as their imitation of human actions can lead to harm, such as rendering people incapable of handling romantic relationships or increasing comfort with sexual partners.

Robots in healthcare are revolutionizing the industry, enabling telehealth, medication delivery, and complex surgeries. However, ethical concerns arise regarding privacy, surveillance, data collection, human worker displacement, and the impact on care providers. A coherent ethic for using robots in medicine should be based on quality in human life, considering patients' physical, emotional, and relational needs, as well as providers' engagement and loved ones' involvement.

As autonomous robots become more autonomous, the responsibility for failures becomes more complex. Factors such as driver reaction speed, safety features, and city officials' permission should be considered. To build greater safety, efforts should involve input from all affected parties, including taxi drivers, pedestrians, and cyclists. Regulations can help maintain transparency, and people must be prepared to incorporate robots into community planning and policymaking. In conclusion, a coherent ethic for using robots in healthcare should prioritize human dignity and consider the potential risks and benefits.

As robots become more lifelike, there are ethical considerations regarding their treatment. Empathy with robots can lead to mistreatment, as seen in a 2015 video of employees kicking a robotic dog. Some argue that creating robots that can masquerade as humans is unethical, as it could lead to human degradation or a rise in similar behavior towards fellow humans. One possible answer is to consider robots as entities with which people have established a relationship, similar to how we feel a different duty to an animal we keep as a pet than to one we raise for meat. The rise of fully- or partially automated weapons systems raises new ethical dilemmas, as opponents argue that reducing war's human costs could make it easier for politicians to justify military action. The ultimate ethical question raised by killer robots is whether the use of fully automated weapons is justified under any circumstances.

#codingexercise: CodingExercise-05-03-2025.docx

Friday, May 2, 2025

 These are the steps in a typical cnn based vision processor for drone images. Let’s enumerate them:

1. Initialization: Drone Images are 512x512 resolution images. They are not labeled in pascal voc format. Before each image in drone video is processed, the model is initialized as a 7-layer CNN with activation and sigmoid. Activation functions introduce non-linearity to neural networks allowing them to learn complex patterns such as edges, textures and shapes by adjusting neuron outputs before passing them to the next layer. Sigmoid is a mathematical function that squashes the input values between 0 and 1 that makes it useful for probability-based tasks including drawing heat-maps discussed earlier. The specific one used with this model is one that combines sigmoid and binary cross-entropy loss into a single operation for numerical stability for binary classification tasks. Hyperparameters for the model such as learning rate, targets and masks are set to default values. Optimizers are essential to neural network for updating its weights during the training process and help in finding the optimal set of weights that minimize the loss functions. A loss function measures the difference between the predicted and actual values of the target variable. The optimizer used with this model is one that implements the Adam algorithm.

2. Each convolutional layer transforms using input and output channels. It involves an activations scheme of Rectified Linear Unit aka ReLU which takes a value only if its positive and 0 otherwise. During training, each layer has a default value for dropout as none, padding as same and batchnorm and transpose as turned off. Dropout prevents overfitting by randomly setting a fraction of neurons to zero. Padding are extra pixels around the borders of an image before a convolutional operation. Batch normalizations normalize activation around a mini batch of data. Transpose or Transposed convolution often called deconvolution or upsampling is used to increase spatial dimensions reversing the standard convolutional process.

Kernel and biases are also set for each layer. Kernel used is a 3x3 with an initializer that generates a truncated normal distribution on the input channels for transformation to output channels. Biases only affect the output channel with a constant initializer.

3. location: Pixel co-ordinates are transformed to world co-ordinates. The alignment data is stored in the bounds which helps to transform the data in the raw frame to the detections in the world coordinates. This involves perspective transformation using OpenCV’s method to find the homography matrix which describes the transformation between two sets of corresponding points in two different images.